Skip to main content

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.

  1. install GPG (if you are using GitBash probably you already have gpg installed)
  2. create key-pair gpg --gen-key and 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mypwd 0.9.4
File Size Uploaded Provenance Actions
mypwd-0.9.4.tar.gz 39.0 kB Without provenance Details for mypwd-0.9.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mypwd 0.9.4
File Interpreter ABI Platform Actions
mypwd-0.9.4-py3-none-any.whl Python 3 none any Details for mypwd-0.9.4-py3-none-any.whl

Total release size: 56.7 kB

Release files / mypwd-0.9.4.tar.gz

Download URL mypwd-0.9.4.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ce5cd897179ec3527ea52f272e041375cfad2c5275632fc3c5a3e33b5d01d43b
BLAKE2b-256 checksum
How to use checksums
17303b6be5f6b9b35e36c63c4948b283fe748e43d303534cb5b8fcd3d160f7d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.4-py3-none-any.whl

Download URL mypwd-0.9.4-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8df23cfb4b8c92ea61d73b577a46a03682c796051ae71d346ae30215a6655cba
BLAKE2b-256 checksum
How to use checksums
012daba3d29c10b0ee39d82be1778dcdb4e094679b135f94f09bc142c7df63e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page