Skip to main content

keyring backend plugin to retrieve credentials from environment variables.

Project description

PyPI Status Python Version License

PyPI - Downloads

pre-commit Black Poetry

keyrings.envvars is a keyring backend plugin for the keyring utility that provides credentials via environment variables.

Requirements

  • keyring >= 23.4.0

  • Python >= 3.9

Installation

You can install keyrings.envvars via pip from PyPI:

$ pip install keyrings.envvars

Usage

keyrings.envvars uses the following format for environment variables:

KEYRING_SERVICE_NAME_<n>=<service>
KEYRING_SERVICE_USERNAME_<n>=<username>
KEYRING_SERVICE_PASSWORD_<n>=<password>

Example for usage with pip credentials:

KEYRING_SERVICE_NAME_0=https://private-pypi-index.example.com
KEYRING_SERVICE_USERNAME_0=testusername
KEYRING_SERVICE_PASSWORD_0=testpassword
KEYRING_SERVICE_NAME_1=https://another-private-pypi-index.example.com
KEYRING_SERVICE_USERNAME_1=testusername
KEYRING_SERVICE_PASSWORD_1=testpassword

Note: Defining multiple identical credentials (service name and username) will result in the last defined password being returned as the environment variables are sorted by the keyring backend.

export KEYRING_SERVICE_NAME_0=https://private-pypi-index.example.com
export KEYRING_SERVICE_USERNAME_0=testusername
export KEYRING_SERVICE_PASSWORD_0=testpassword
export KEYRING_SERVICE_NAME_1=https://private-pypi-index.example.com
export KEYRING_SERVICE_USERNAME_1=testusername
export KEYRING_SERVICE_PASSWORD_1=testpassword_1
keyring get https://private-pypi-index.example.com testusername
testpassword_1

Contributing

Contributions including suggestions, pull requests, etc. are very welcome. keyrings.envvars uses Conventional Commits format for commit messages.

Run nox before committing any changes.

License

Distributed under the terms of the MIT license, keyrings.envvars is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Please read https://www.chiark.greenend.org.uk/~sgtatham/bugs.html before you file an issue.

Credits

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.

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

keyrings_envvars-1.0.5.post1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keyrings_envvars-1.0.5.post1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file keyrings_envvars-1.0.5.post1.tar.gz.

File metadata

  • Download URL: keyrings_envvars-1.0.5.post1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.2 Linux/6.1.0-11-amd64

File hashes

Hashes for keyrings_envvars-1.0.5.post1.tar.gz
Algorithm Hash digest
SHA256 8f666512acee57eafea0ca4c9298bd71b11b3458a0c0d84a28b112aa0d826605
MD5 f8bb277f32466bdd5de5eba6a649f728
BLAKE2b-256 dd96726fcc7bc1d537a6c0b6ffb6b6bf698f14429f57fec754aa7dd995811711

See more details on using hashes here.

File details

Details for the file keyrings_envvars-1.0.5.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for keyrings_envvars-1.0.5.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 731ee84330b26eb77eef9591ebf87953a1e21f66b40090c39b0a62228e83a288
MD5 09b969b346fa60f70efb21811981d420
BLAKE2b-256 eb953f0db51853cc41bfa7bf3d522645d2e6b059479169e9dc977e048278587d

See more details on using hashes here.

Supported by

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