Skip to main content

A module to handle secrets outside of projects

Project description

Stored Secrets handling module in Python

storedsecrets is a module implementing a simple approach to keep your secrets (API keys, passwords, ...) outside of your project files, so that you can protect them better (e.g. in an encrypted archive, or any form of external volume), and you don't leak them accidentally through your favorite versioning tool and platform.

storedsecrets exposes a StoredSecrets class to handle your secrets.

Typical usage:

>>> import storedsecrets
>>> my_secrets = storedsecrets.StoredSecrets("mysecretfile.json")
>>> API_KEY = my_secrets.get('API_KEY')

If the path of the file is not absolute, it will be searched for in the directory named in env var SECRETS, or in ~/etc/secrets by default.

This is minimalist work for the moment.

Ideas for the future

  • make sure all aspects of list / dict are implemented (iterables)

  • could be interesting to implement a kind of path (à la XPath) search for secrets - secrets['a/sub/secret'] instead of inelegant secrets['a']['sub']['secret'].

  • get ready for Docker? Allow the use of Docker Secrets?

  • manage the "set" operations ? Might not be a good idea, though.

Track changes

Changes in 0.1.3

  • the load function no longer fails silently, but raises the caught exception again. This is more pythonic.

  • a __getitem__ function has been added, allowing the use of [] notation to get an element.

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

storedsecrets-0.1.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

storedsecrets-0.1.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file storedsecrets-0.1.3.tar.gz.

File metadata

  • Download URL: storedsecrets-0.1.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.6

File hashes

Hashes for storedsecrets-0.1.3.tar.gz
Algorithm Hash digest
SHA256 01d1b1bf3b31408db59cd8603ef9324c8a16213cdd617fcbbf4b68111a21a6db
MD5 95f1ec9f4d03b7c04d4c053233f199f3
BLAKE2b-256 b2152ee7b5bc6dfff0a203d8abe816fd5e345ca2229820b0bea566ee93d053a7

See more details on using hashes here.

File details

Details for the file storedsecrets-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: storedsecrets-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.6

File hashes

Hashes for storedsecrets-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 043b1878312a5058072b9fe7474b71e865df6044b80e25084c01ec466b377791
MD5 e4eff834de2d3b463130b456ac669013
BLAKE2b-256 9663de81b18b90eef16f44163003deca1107de973370cebe5b4e4d9a5b31d8fa

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