Skip to main content

config dictionary with YAML sourcing and secret support

Project description


Configuration package

Why Though?

This is the simplest config interface with text file support.


  • seemless Python dict interface
    • unified config definition and defaults
  • YAML text file source for file-system input & serialization
  • simple precedence
    • defaults keys define config keys
    • YAML values override defaults values
  • secrets support
    • secrets saved to private YAML
    • auto-updates from public YAML


Config Definition and Defaults

import figtion

defaults = {'my server'       : 'www.bestsite.web'
           ,'number of nodes' : 5
           ,'password'        : 'huduyutakeme4' }
cfg = figtion.Config(defaults=defaults,filepath='~/conf.yml')

print(cfg['my server'])  

This will print 'www.bestsite.web' unless the value of 'my server' in ~/conf.yml has something else.

Config Secrets

When you want a public config file and a separate secret one.

cfg = figtion.Config(defaults=defaults,filepath='~/conf.yml',secretpath='/opt/creds.yml')


This will print the value of 'password', which is stored in /opt/creds.yml and not ~/conf.yml. If the value of 'password' is changed in either YAML file, the password will be updated and masked from ~/creds.yml again the next time the class is loaded in Python. The python class always return the correct value.


  • 0.9 - secrets store in separate location
  • 1.0 - secrets store in encrypted location

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 figtion, version 0.9.2
Filename, size File type Python version Upload date Hashes
Filename, size figtion-0.9.2-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size figtion-0.9.2.tar.gz (3.7 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