configstore
configstore is a small pluggable library that lets you retrieve settings or secrets from a variety of storage systems to configure your app.
The main pain point this tries to solve is:
Assume you have your config in environment variables but you want to store your secrets in something else. How do you mix having a secret backend for your secrets but still keep everything else in environment variables? With this module you can use both. Let’s say you use DATABASE_PASSWORD as your database password env variable. This will first try to find this in your first backend (let’s say docker secrets) and if it fails will fall back on the env variable.
See example.py for some example code.
Available backends
configstore.EnvVarBackend finds settings in environment variables. This is the classic 12-factor approach, which main drawback is that it’s easy for outside tools or sub-processes to inspect the environment and access sensitive data. This backend is still useful for settings that are not secrets.
configstore.DotenvBackend lets you put settings in a key-value format file, using the dotenv module, which is useful for local development. This backend requires an optional dependency, so use a requirement like configstore[dotenv] to get everything installed.
If you are using docker-compose, another dotenv module is already installed and does not provide the same interface; use a requirement like configstore[pydotenv] instead. DotenvBackend is automatically compatible.
configstore.DockerSecretBackend can read Docker secrets. This is a secure storage with first-class support in the Docker runtime and related tooling.
configstore.AwsSsmBackend connects to the Parameter Store service that is part of AWS Systems Manager. This backend requires optional dependencies (boto3), so use a requirement like configstore[awsssm] to get everything installed.
Finally, configstore.DictBackend is useful to define a bunch of settings for testing or for defaults.
Contributors
Original author: Antoine Reversat @crevetor
Current maintainer: Éric Araujo @merwok
Project sponsored by Caravan Coop @caravancoop
Metadata
Release files for configstore 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| configstore-0.9.tar.gz | 12.2 kB | Without provenance | Details for configstore-0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| configstore-0.9-py3-none-any.whl | Python 3 | none | any | Details for configstore-0.9-py3-none-any.whl |
Total release size: 20.2 kB
Release files / configstore-0.9.tar.gz
| Download URL | configstore-0.9.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd0e46582749b0bf5b0cc699ddf5cfe077e03d46ba654255344d7f082416639a
|
|
BLAKE2b-256 checksum How to use checksums |
e3b86546618cc25c95f65637b15c478322eed3e42170e400fc3a1fc2834cbcd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / configstore-0.9-py3-none-any.whl
| Download URL | configstore-0.9-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9abc566f9e6e855c1396647d1cd7c0bb2a5da059bea41305a3208dc800a7da9
|
|
BLAKE2b-256 checksum How to use checksums |
5f6afdd42c09f9a00ffeeb345544e01f260bbc3d656e08d6f1ae2d4fa18e437e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for configstore 0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.