This release is a pre-release and may not be stable for production use.
Introduction
bicop is a python library to process ISC bind-style configuration files. These are nested structures that look like this:
datasource1 {
server "server1.your.domain";
username "client";
password "secret";
extra {
isolation "full";
};
};
tables {
"users";
"groups";
};
Parsing
Parsing is trivial using the ‘’parse’’ method:
from bicop import parse
parse("/etc/bind/named.conf")
This returns a standard python dictionary with all data read from the file. Entries in the dictionary can be other dictionaries or lists.
Merging
A common need is to be able to support default values for configurations or to handle configuration at multiple levels with priorities, for example a uer configuration overriding entries from the system-wide configuration. To support this bicop has a utility method that can merge dictionaries. You can use it like this:
from bicop import parse
from bicop import merge
configuration=parse("/etc/application.conf")
userconfig=parse("/home/user/.application")
merge(configuration, userconfig, overwrite=True)
Easy access for nested dictionaries
Configuration files in this format can have deeply nested structures. Accessing those using standard python dictionaries is a slightly cumbersone. To make this a bit more pleasant on the eyes you can use the NestedDict wrapper:
from bicop import parse
from bicop import NestedDict
configuration=NestedDict(parse("/etc/application.conf"))
print "Your signature is: %s" % configuration["profiles/user/signature"]
Changes
1.0rc2 - August 2, 20009
Add an optional dictclass parameter to the parse method. This can be used to use alternative dictionary types, most typically ordered dictionaries.
Drop dependency on nose to run tests.
Use ez_setup to automatically install setuptools if needed.
Metadata
Release files for bicop 1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bicop-1.0rc2.tar.gz | 9.6 kB | Without provenance | Details for bicop-1.0rc2.tar.gz |
Release files / bicop-1.0rc2.tar.gz
| Download URL | bicop-1.0rc2.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6969171cf7f064738e13f6b045d24e4b54100c1d1e4e3fbee9bd89f8c069715e
|
|
BLAKE2b-256 checksum How to use checksums |
7290b7cf47a8a19eaeab838ce180f8c978ec7a49dbdeafd61bc8a2a52b8de542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bicop 1.0rc2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.