Python package to ease the configuration of packages
Project description
Goal
The goal of this package is to offer an easy, generic and extendable way of configuring a package.
Installation
$ pip install pkgsettings
Usage
from pkgsettings import Settings
# Create the settings object for your package to use
settings = Settings()
# Now lets defined the default settings
settings.configure(hello='World', debug=False)
By calling the configure you actually inject a layer of settings. When requesting a setting it will go through all layers until it finds the requested key.
Now if someone starts using your package it can easily modify the active settings of your package by calling the configure again.
from my_awesome_package.conf import settings
# Lets change the configuration here
settings.configure(debug=True)
Now from within your package you can work with the settings like so:
from conf import settings
print(settings.debug) # This will print: True
print(settings.hello) # This will print: World
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
pkgsettings-0.9.1.tar.gz
(11.5 kB
view hashes)