A flexible, intuitive native-python configuration system.
Project description
npconf is a flexible configuration system whose configuration files are plain python modules. The identifiers (left-hand side) are declared by the administrator/developer and are hierarchical. A typical configuration file might be:
myapp.subcomponent.value = 1
myapp.enabled = True
The user needn’t define “myapp”. It’s automatically included in globals().
The administrator/developer can disallow user-defined attributes. This is mostly intended to prevent typos in the configuration files. In other words, if myapp.foo is not defined before reading the configuration files, no file will be allowed to set myapp.foo.
The configuration attributes are normally declared by a program before it reads any configuration files. They can be declared at init time:
import npconf
root = npconf.ConfigValue(name='myapp', data={'enabled': 'false'})
# and/or updated after init:
root.update(data={'thing': None})
# to add another level to the hierarchy:
subcomponent = npconf.ConfigValue(
name='subcomponent',
data={
'foo': 'banana',
})
root.update({'subcomponent': subcomponent})
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
File details
Details for the file npconf-0.0.3.zip
.
File metadata
- Download URL: npconf-0.0.3.zip
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2c98e6bf61113854e9f461b39cfaf1a8a2f7e226d4301f67919e395ad9083e4 |
|
MD5 | 3eb8d4dead03f16cf0cf22dc6c631ce1 |
|
BLAKE2b-256 | fe1070b5f64c3610914bde4e480b09caf820df5f3e14f499249bb665af32e214 |