Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Makes securely getting, storing, and retrying passwords from a command line interface easy!

Project description

cli-passwords

https://img.shields.io/pypi/v/cli_passwords.svg https://img.shields.io/travis/timmartin19/cli_passwords.svg Documentation Status Updates

Makes securely getting, storing, and retrying passwords from a command line interface easy!

Features

  • Get passwords from the keyring and if it’s not there prompt the user to securely enter their password. The password will be stored in their keyring and they will not be prompted for their password again
  • Inject passwords into functions using the process described above
  • Automatically prompt the user to re-enter their password when they inputted the incorrect one

Installation

pip install cli-passwords

Quick Start

Prompt the user for the password and store the password in their keyring. This password will perists until expire_password is used or the keyword argument refresh=True is passed into the function.

from cli_passwords import get_password

# This will prompt the user for their password on the first
# use only.  Whether it's a month later or minutes later, it
# will pull the password from the keyring and not prompt the user again
password = get_password('namespace', 'username')

Inject the password into a function and retry when the password is incorrect. You can specify the maximum number of retries using the retry keyword argument

from cli_passwords import retry_password

@retry_password('namespace', 'username', exception=AuthenticationException)
def my_func(password, arguments):
    if password is not correct:
        raise AuthenticationException('The password is wrong')
    else:
        # do something with the password

my_func('arguments')

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2016-07-21)

  • First release on PyPI.

Project details


Download files

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

Files for cli_passwords, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size cli_passwords-0.1.2-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size cli-passwords-0.1.2.tar.gz (14.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page