A Python configuration library that's music to your ears.
Project description
configaro configuration library
What is it?
configaro
is a Python 3 configuration library that's music to your ears.
Why should I care?
configaro
has been created with the following design goals in mind:
- provide a single file library with minimal dependencies
- provide one with a simple, expressive API that is easy to use and gets out of your way
- provide one that allows for hierarchical config data supporting dot-addressable access
- provide one that allows for defaults and locals config modules
- provide one with complete test coverage
- provide one with complete documentation
If this sounds appealing to you, take a look:
import configaro as cfg
# Initialize the library with the name of the package containing your defaults.py config module
cfg.init('mypkg.config')
# Get the entire config object
config = cfg.get()
print(config) # prints "{'greeting': 'Hello', 'subject': 'World'}"
# Config object provide attribute access style in addition to dict access style.
print('f{config.greeting}, {config.subject}!') # prints "Hello, World!"
# Config objects may be updated quite flexibly as well.
cfg.put(greeting='Goodbye', subject='Folks'}
cfg.put({'greeting': 'Goodbye', 'subject': 'Folks'})
cfg.put('greeting=Goodbye subject=Folks')
What about Python 2?
I have zero interest in supporting Python 2 at this point. If you are still using Python 2 then move along -- there's nothing to see here.
Installation
configaro
may be installed from the Python package index:
$ pip3 install configaro
configaro
may also be installed from source:
$ git clone https://github.com/mojochao/configaro.git
$ pip3 install .
If you install from source with .[dev]
you should be able to run tests:
$ pytest
Documentation
configaro
documentation is hosted on Read The Docs
and should be consulted for information on integrating it into your project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for configaro-0.9.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e65c92c9c6f53686568ec504539c1be2f7d3955c9c68794baab1f340aab0d9 |
|
MD5 | aa01bbfc702f61ccdabf29082dc9a527 |
|
BLAKE2b-256 | c700f40bb73e426aa58263c5a321c7a988d7395ad5261b4e0a6e44b1c92a9be7 |