Skip to main content

Yaml-based configuration file reader. This is a fork of the original yamlfconf package. This fork is maintained by WMF Machine Learning Team

Project description

This library provides a means to read yaml configuration files and propagate default values in reasonable ways. Nothing complicated.

  • Installation: pip install yamlconfig

Example:
>>> import yamlconf
>>>
>>> doc = yamlconf.loads("""
... test: demo_test
...
... tests:
...     defaults:
...         foo: 5
...     demo_test:
...         bar: 6
... """)
>>>
>>> doc['tests'][doc['test']]['foo']
5
>>> doc['tests'][doc['test']]['bar']
6
Functions:

  • load(file-like) : Returns a dict with defaults propagated

  • loads(string) : Returns a dict with defaults propagated

  • load_module(class-path) : Imports and returns

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

yamlconf-wmf-0.2.10.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

yamlconf_wmf-0.2.10-py3-none-any.whl (8.1 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