Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

manage your secrets and configurations easily

Project description

secretconf []


Manage your secret configurations easily


pip3 install secretconf --user


secretconf is a library to manage (encrypt/decrypt) your credentials on demand using public key encryption.


hush is a commandline utility installed with secretconf to make your life easier to store and update credentials

hush --section twittermain --fields 'user,__token' --privatekey ~/.ssh/id_rsa  
hush --help
Usage: hush [OPTIONS]

    --section TEXT     Section (Appname)
    --privatekey TEXT  Privatekey path
    --configpath TEXT  Secret configuration path
    --fields TEXT      quoted comma separated fields; secret fields are prefixed with __
    --help             Show this message and exit.

Data storage

You can configure where to save the data using --configpath which is set to /tmp/secrets.conf by default.

user = ahmed
__token = eYCWre9l7IauoHs6K3D5J2wkgnQQBtFV4CoZE3W4tpbxa7Z7Qt+c/LnQhSI=

Please notice that you can't use multiple keys on the same configpath file

API usage

secretconf documentation


def test_make_config_creates_file_with_encrypted_data():
    make_config(APPNAME, {'user': USER, '__password': PASSWORD},
                config_path=TEST_CONFIG_PATH, private_key=hashedsk)

    assert os.path.exists(TEST_CONFIG_PATH)
    with open(TEST_CONFIG_PATH, 'r') as f:
        content =
        assert "user" in content
        assert USER in content
        assert "__password" in content
        assert PASSWORD not in content


    conf = read_config(APPNAME, config_path=TEST_CONFIG_PATH,
    assert APPNAME in conf
    assert 'user' in conf[APPNAME]
    assert '__password' in conf[APPNAME]
    assert conf[APPNAME]['user'] == USER
    assert conf[APPNAME]['__password'] == PASSWORD


secretconf tests exists in tests directory

  • basic tests encryption/decryption and usage of make_config and read_config
  • property based tests

You can use pytest tests or just tox make sure to install requirements-test.txt or make test

Generating Docs

make gendocs


  • setuptools==38.5.0
  • click==6.7
  • PyNaCl==1.2.1
  • npyscreen==4.10.5


Software is provided as is under BSD 3-Clause License


secretconf was written by Ahmed Youssef <>_.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for secretconf, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size secretconf-0.1.2-py3-none-any.whl (7.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size secretconf-0.1.2.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page