Skip to main content

Manage configuration files from multiple source in python

Project description


Manage configuration files from multiple source in python. Create a variable directory for your configuration sources.

Directories contain sources and each source has a priority. The lower the priority value, higher is the priority. When you retrieve a variables, it looks into all the sources and retrieve the one with the highest priority. For eg, you have added two source -

  • source1 : json config file - contain default values - priority = 10
  • source2 : url - contains overrides - priority = 5

It will look into source 2 first, if not found will search in source1 , if then not found will raise "UndefinedVariableException"


Use pip install catilo to install Catilo

Import the module at the start and define a variable directory.

from catilo.catilo import VariableDirectory
my_directory = VariableDirectory()

For simple dictionaries:

    "fruit": "Apple",
    "size": "Large",
    "color": "Red"
value = my_directory.get("fruit") ## returns "Apple"

For yaml/json based files


For URL's

value = my_directory.get("fruit") ## returns "Apple"

For Environment variables

value = my_directory.get("CATILO_my_variable")

## If you don't want to strip the prefix during get, use `strip_prefix=True`
value = my_directory.get("my_variable")


  1. Allows you to store multiple configuration files with priority value.
  2. Support for the following sources
    1. python dictionaries
    2. yaml files
    3. json files
    4. url (get method, json format)
    5. Environment variables
  3. Ability to add custom sources
  4. Stores config in flat_dictionary (can be overriden) for '.' notation access
  5. Ability to add variables in runtime
    1. Add as default variable
    2. Add as normal variable
  6. Output multiple sources into a single json or yaml file

Project details

Download files

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

Source Distribution

catilo-0.2.6.tar.gz (18.0 kB view hashes)

Uploaded Source

Built Distribution

catilo-0.2.6-py3-none-any.whl (18.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page