Skip to main content

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] or Callable[[Any], bool])
  • Add dict methods (keys, __getitem__, etc) to Blueprint
  • Exceptions ConfigError, ParseError, RequiredError, and OptionError
  • Remove namespaces

Project details


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)

Uploaded Source

Built Distribution

bconfig-2.0.0b2-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page