Skip to main content

Easy program configuration for Pandas.

Project description

ConfigurationPanda provides easy loading and access to the data elements of JSON based configuration files.

It works by finding JSON configuration files within specified locations and loads each file onto an object attributes so that program internals can easily obtain necessary settings without developers having to write routine open() and json.loads() operations.

It is an opinionated library which attempts to encourage fellow developers to:

  1. Avoid Borg-like single configuration files containing all your passwords, settings, etc. Instead, as each configuration file becomes a namespace on the ZenConfiguration object, the contents of that file should be explicitly tied to the namespace.
  2. Avoid hardcoding configuration file paths into your programs. The program stubbornly insists on working with environment variables only.
  3. Use JSON rather than CONF files, which are much more portable when operating in a heterogeneous programming environment. My condolences if you have to work with .Net


Assuming that an environment variable ‘SHARED_CONFIG_FILES’ exists and points to a directory containing multiple JSON files, including the following:

    "primary": {
        "url": "ldaps://",
        "login": "cn=LDAP Testing",
        "password": "LDAP Password"

    "TestAccount1": {
        "url": "",
        "login": "testaccount1",
        "password": "testaccount1password"

You would access the contents of those configuration files like this:

>>> from configuration_panda import ConfigurationPanda
>>> program_settings = ConfigurationPanda(['SHARED_CONFIG_FILES'])
>>> program_settings.ldap['primary']['url']
>>> program_settings.smtp['TestAccount1']['login']

BONUS! Set Environment Variables

ConfigurationPanda will also set additional environment variables for you!

If during a scan of the location specified the environment variable (sorry, you have to set one yourself), a JSON file is found with the name ‘environment_variables.json’, an attempt will be made to create an environment variable from each entry within the JSON file.

For instance:

    "MY_FAVORITE_FOOD": "Dumplings",
    "MY_WORST_NIGHTMARE": "The Noodle Dream"

This functionality allows you to dynamically insert environment variables at runtime based on a configuration variable rather than having to make them a permanent fixture in a .bash_profile or .bash_rc file.

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 configuration-panda, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size configuration-panda-0.5.tar.gz (4.4 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