Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pior/ecfg
Python library to decrypt EJSON files
https://github.com/pior/ecfg
Last synced: 2 days 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:54:06.000Z (about 2 years ago)
- Last Synced: 2024-12-22T09:32:24.548Z (about 1 month 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
[![Version](https://img.shields.io/pypi/v/ecfg.svg)](https://pypi.python.org/pypi/ecfg)
[![License](https://img.shields.io/pypi/l/ecfg.svg)](https://pypi.python.org/pypi/ecfg)
[![PythonVersions](https://img.shields.io/pypi/pyversions/ecfg.svg)](https://pypi.python.org/pypi/ecfg)
[![Build](https://travis-ci.org/pior/ecfg.svg?branch=master)](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')
```