Skip to content

patarapolw/pypwm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Py Password Manager

Build Status PyPI version shields.io PyPI license PyPI pyversions PyPI status Examples tested with pytest-readme

A library for password manager for Python

Features

  • Automatic vault locking and saving after predefined time (default 60 sec)
  • Vault file generation
  • Passcode lock with RSA (based on PyCryptodome)

Installation

pip install pypwm

or

pipenv install -e git+https://github.com/patarapolw/pypwm.git#egg=pypwm

Usage

from pwm.vault import Vault

with Vault('amasterpassword') as vault:
    vault['reddit'] = {
        'password': 'averycomplexpassword'
    }
with Vault('amasterpassword') as vault:
    print(vault['reddit']['password'])

Real-world usage

do_exit = False

while not do_exit:
    try:
        while True:
            try:
                vault = Vault(getpass('Please enter the master password : '))
                break
            except ValueError:
                continue

        while not do_exit:
            print('Password available for:', ', '.join(dict(vault).keys()))
            name = input('Please type the name of password to view or create a new one, or press q to exit. : ')
            if name == 'q':
                do_exit = True
                break

            new_entry = dict(vault).get(name, {
                'password': generate_password(),
            })
            print(new_entry)
            if input('Do you want to save? Press [y/Y] to save: ').lower() == 'y':
                vault[name] = new_entry

        vault.close()

    except AttributeError:
        continue

Found in

About

A library for password manager for Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages