Skip to main content

Very simple password manager for my 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.

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.7.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

mypwd-0.7.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mypwd-0.7.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mypwd-0.7.0.tar.gz
Algorithm Hash digest
SHA256 e4895811191777140c610c7d1f0061a7868e3b9f368dd90429842cb84f35dbf4
MD5 2ab50595814e43861ba8b9594dcb7358
BLAKE2b-256 60bf06749220ccc37a2146a9587ab6e8890b40d1c9b4ae2832845d156fa3af98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mypwd-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mypwd-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df92e7079b1c69e35902e54508f4a1dce8a7099e7160a1b7c1aa408ebd426741
MD5 fdd9c3b2f7066acd5a816b50c69731a7
BLAKE2b-256 972ca757aa3c31412704a295bcf91d5c587138c177107105b9305c52beb4a9c1

See more details on using hashes here.

Supported by

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