Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 716 Bytes

README.md

File metadata and controls

32 lines (26 loc) · 716 Bytes

Nonoconfig

Zero configuration configuration library.

Installation

Install this library using:

%> pip install nonoconfig

Usage

# $ cat ~/.config.yaml
# key:
#   subkey: value
>>> import nonoconfig
# Initialize the module with a given list of possible configuration file locations
>>> nonoconfig.init("./config.yaml", "~/.config.yaml", "/etc/config.yaml")
# Get values from the first existing location with
>>> nonoconfig.config()
{'key': {'subkey': 'value'}}
# Get parts of the config
>>> nonoconfig.config("key")
{'subkey': 'value'}
>>> nonoconfig.config("key", "subkey")
'value'
# Fetch non existing key
>>> nonoconfig.config("this", "key", "does", "not", "exists")
# Returns None