Skip to main content

Flexible yet simple password reader and writer.

Project description

Flexpass

Flexible yet simple password reader and writer.

WARNING: alpha stage. Not suitable for production.

Install

pip install flexpass

Feature

This library provides read/write access to passwords identified by a name, through the following functions:

def get_password(name: str) -> str|None:
    ...

def set_password(name: str, password: str, **options) -> None:
    ...

def delete_password(name: str) -> bool:
    ...

def list_passwords() -> list[PasswordInfo]:
    ...

Function get_password requests all registered backends by decreasing priority until the password is found.

Function set_password sets the password in the read-write backend with the highest priority.

Function delete_password deletes the password in all read-write backends where the password was set. It returns True if the password was set in at least one backend.

Function list_passwords returns a list of the password names associated with information from the backends.

Access to passwords is also possible for a specific backend, by using this backend method. Examples:

backend = get_backend('pass')
backend.get_password('my/password')

These functions are also accessible through a command-line interface. See:

flexpass --help

Backends

The following backends are included:

Name(s) Priority Description
pass, gpg 10
libsecret 6
wincred 5
runsecrets 3
env 1

Additional backends may be added using register_backend_class function.

Priorities may be modified by calling register_backend_class again with priority argument.

NOTE: use priority 0 to disable a backend.

Credits

I was inspired by:

  • pass
  • keyring. Differences:
    • keyring is a lot more mature and has many more backends.
    • flexpass does not require to specify a username in addition to the password name.
    • flexpass aims at including common password managers without requiring additional packages, especially for servers without desktops and for Docker containers.
    • flexpass gives easily access to the list of passwords.

Icon created by Pixel perfect - Flaticon.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

flexpass-0.0.1a1-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

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