Very simple password vault for Python projects.
I often forgot the passwords in my scripts and committed them to the repository. So I created a simple password vault so that it doesn't happen to me anymore.
1. Usage
1.1 Basic setup and usage
Install mypwd module.
pip install mypwd
Now you can use mypwd your project:
import mypwd
login, password, server = mypwd.get_values("mongo-dev", ["login", "password", "server"])
uri = f"mongodb://{login}:{password}@{server}/admin?retryWrites=true&w=majority"
When you run it first time mypwd creates vault in your $HOME directory and will ask you for login, password and server of your mongo-dev entry and store it in your vault $HOME/mypwd.json.
Here is an example of vault content:
{
"mongo-uat": {
"login": "appl",
"password": "hS78#pbTgc#J.CQL",
"server": "myserver-uat.com"
},
"mongo-dev": {
"login": "appl",
"password": "VacK>p3k3~t*c~RX",
"server": "myserver-dev.com",
"note": "Valid until end of month"
}
}
Now you can access your secrets from python code and you will never commit secret anymore.
1.2 Keep your passwords safe and encrypt mypwd.json with GPG
You should store your passwords in encrypted file mypwd.json.gpg instead of in plain text file mypwd.json.
- install GPG (if you are using GitBash probably you already have gpg installed)
- create key-pair
gpg --gen-keyand assign it to your e-mail
Now you can encrypt your mypwd.json with your gpg key:
mypwd encrypt -e your.email@something.com
and later on you can decrypt it back for some manual modification:
mypwd decrypt
2. Installation
Installation is simple:
pip install mypwd
or
python setup.py install
3. Contribution
Feel free create issue or pull request.
Please install pre-commit before commiting your changes
uv run pre-commit install
Metadata
Release files for mypwd 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mypwd-0.9.3.tar.gz | 39.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mypwd-0.9.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.8 kB
Release files / mypwd-0.9.3.tar.gz
| Download URL | mypwd-0.9.3.tar.gz |
|---|---|
| Size | 39.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cd667c846fd213b97fefdd35a58709d75429140e20a05e72058c2a8553158fc
|
|
BLAKE2b-256 checksum How to use checksums |
d2974c634e4251a0ebd34ba32cccff2c336a3e75b304f1da755708be8ba6c3de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mypwd-0.9.3-py3-none-any.whl
| Download URL | mypwd-0.9.3-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74795a3a458fc5ae8182b09fc16b30758f4bf16a69eabe1ddc36639f916abdb0
|
|
BLAKE2b-256 checksum How to use checksums |
ad0c49cdfdbae923b9a868b95e4367c76bd392213a2fdc2f4dbdc330b2a51f56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mypwd 0.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.