Blueprints for configurations
Project description
bconfig (Blueprint Configuration)
Example
import bconfig
example_config_blueprint = bconfig.Blueprint({
'example_int': bconfig.Field(int, options=[122, 123, 124]),
'example_sub_config': {
'foo': bconfig.Field(float)
}
})
example_config = example_config_blueprint.parse({
'example_int': '123',
'example_sub_config': {
'foo': '1.23'
}
})
print(example_config['example_int'] + 1) # 124
print(example_config['example_sub_config']['foo'] + 0.01) # 1.24
To Do
- Example code
- Unspecified parse functions
- Unspecified expected types
- Lists
- Options (
List[Any]
orCallable[[Any], bool]
) - Add dict methods (keys, __getitem__, etc) to Blueprint
- Exceptions
ConfigError
,ParseError
,RequiredError
, andOptionError
- Remove namespaces
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
bconfig-2.0.0b2.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for bconfig-2.0.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72052783da59ee8ebe2b8f983f8c8ffaf9b89c3e4b7066e06738f1f6654516da |
|
MD5 | 617f48eb4ce8bd884c5e11793ebb6826 |
|
BLAKE2b-256 | 0114744f0a109aba171ba0da28eb3116fa579db3d3f64d252916bccdc39421b6 |