config

The config package makes it easy to manage environment specific configuration values. For example, you might want to use distinct values for development, testing, and production environments.

Installation

The package is not yet available on PyPI, but you can install it from GitHub:

pip install git+https://github.com/andrie/py-config

Tip: add this to your requirements.txt file:

config @ git+https://github.com/andrie/py-config

And then use pip install -r requirements.txt to install the package.

How to use

Given this config.yaml file:

default:
  trials: 5
  dataset: "data-sampled.csv"
  
production:
  trials: 30
  dataset: "data.csv"

You can read the config file:

import config
config.config_get('trials')
5
config.config_get('trials', 'production')
30