Skip to content

emissions-api/nonoconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages