https://github.com/pior/ecfg
Python library to decrypt EJSON files
https://github.com/pior/ecfg
Last synced: 3 months ago
JSON representation
Python library to decrypt EJSON files
- Host: GitHub
- URL: https://github.com/pior/ecfg
- Owner: pior
- License: mit
- Created: 2018-03-16T00:46:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:54:06.000Z (over 2 years ago)
- Last Synced: 2025-02-27T04:16:51.449Z (4 months ago)
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ecfg
[](https://pypi.python.org/pypi/ecfg)
[](https://pypi.python.org/pypi/ecfg)
[](https://pypi.python.org/pypi/ecfg)
[](https://travis-ci.org/pior/ecfg)Python 3.5+ library to decrypt EJSON files.
## What is this?
[EJSON](https://github.com/Shopify/ejson) is a file format intended to store encrypted
secrets in project repository.
It uses an asymetric encryption ([NaCl Box](http://nacl.cr.yp.to/box.html)) to allow
any developer to add and update secrets while keeping the private key on servers.This project relies on [PyNaCl](https://github.com/pyca/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
```shell
$ pip install ecfg
...
```**Load/Decrypt a file:**
```python
import ecfgsecrets = ecfg.load('config/secrets.production.ejson')
secrets['database_url']
```**Load the `environment` section directly into the process environment (`os.environ`)**:
```python
import ecfgecfg.load_into_environ('config/secrets.production.ejson')
```