Skip to main content

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})

Metadata

Release files for npconf 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npconf 0.0.3
File Size Uploaded
npconf-0.0.3.zip 7.6 kB Details

Release files / npconf-0.0.3.zip

Download URL npconf-0.0.3.zip
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d2c98e6bf61113854e9f461b39cfaf1a8a2f7e226d4301f67919e395ad9083e4
BLAKE2b-256 checksum
How to use checksums
fe1070b5f64c3610914bde4e480b09caf820df5f3e14f499249bb665af32e214
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page