ecfg
Python 3.5+ library to decrypt EJSON files.
What is this?
EJSON is a file format intended to store encrypted secrets in project repository. It uses an asymetric encryption (NaCl Box) to allow any developer to add and update secrets while keeping the private key on servers.
This project relies on PyNaCl for the crypto.
Features
Currently, only loading (decrypting) secrets from ejson files is supported.
More features (encrypt/cli) may be added if needed/requested.
Usage
$ pip install ecfg
...
Load/Decrypt a file:
import ecfg
secrets = ecfg.load('config/secrets.production.ejson')
secrets['database_url']
Load the environment
section directly into the process environment (os.environ
):
import ecfg
ecfg.load_into_environ('config/secrets.production.ejson')