Skip to main content

Very simple password vault for Python projects

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mypwd-0.9.1.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mypwd-0.9.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file mypwd-0.9.1.tar.gz.

File metadata

  • Download URL: mypwd-0.9.1.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mypwd-0.9.1.tar.gz
Algorithm Hash digest
SHA256 6a2f03d3c79e2d6be662d7f343fad5f1a9c70b1fa933c2912549f35264f93a93
MD5 bb6476abad66304043fa87edd62ecdbc
BLAKE2b-256 2b92b6d9eee10939b01eddd04ae661ef15c4e58b9f2956824bb3bc199d225764

See more details on using hashes here.

File details

Details for the file mypwd-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: mypwd-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mypwd-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 461e619616b0e212f63cc2cf4b96c291c54ee9f2dc0af2e30f66e43c6a78ed13
MD5 5e8bb6e43ed7b21b0d87b422c34590bc
BLAKE2b-256 030339f81466367ccbb6b54daf81f6b99e3ca0ef18dc6c62abebabf2e9c06dc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page