Skip to main content

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.

Release files for cli_passwords 0.1.2

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

Source distribution (sdist)

Source distribution for cli_passwords 0.1.2
File Size Uploaded
cli-passwords-0.1.2.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cli_passwords 0.1.2
File Interpreter ABI Platform
cli_passwords-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.1 kB

Release files / cli-passwords-0.1.2.tar.gz

Download URL cli-passwords-0.1.2.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
504ec54051c5830a3c7b867d3d1dc1a1db959d5e1f56559c079a28cbd398e812
BLAKE2b-256 checksum
How to use checksums
d52f94618e47e781bcf1b55e604482642bc60f5ade91c0138b76b41d19c2e627
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / cli_passwords-0.1.2-py2.py3-none-any.whl

Download URL cli_passwords-0.1.2-py2.py3-none-any.whl
Size 6.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9935bca4f8e2e4c02f0b5146d163ed402bbe62338479d5e0a0dd351de7ad2ccb
BLAKE2b-256 checksum
How to use checksums
dc8db9fc2dbf6f566fe5876d6f79f981b55db90fc135d1dad840008caf299e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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