Skip to main content

A config loading and parsing package

Project description


The basic usage pattern is to extend these classes to create your own.

You need a loader:

from configyaml import loader

from .config.root import Root

class SibbellConfigLoader(loader.ConfigLoader):
    config_root_class = Root

Then design your config using additional classes. You need at least 1 to serve as the root class:

from configyaml.config import DictNode
from .dependencies import Dependencies
from .notifications import Notifications

class Root(DictNode):
    """Root of the yaml file"""

    def __init__(self, *args, **kwargs):
        self._dict_fields = {
                    'dependencies': {
                        'class': Dependencies,
                        'required': True,
                        'default': [],
                    'notifications': {
                        'class': Notifications,
                        'required': True,  # no point right now if no notifications
                        'default': [],
        super(Root, self).__init__(*args, **kwargs)

    def _context_to_inject(self):
        """Make dependencies list available to notifcations"""
        return {'dependencies': self.dependencies}

Then to use it, simply create a loader using the configuration text content:

loader = SibbellConfigLoader(yaml_text)
# can now access the configuration and any other properties/method added to their classes


0.1.0 (2017-03-30)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for configyaml, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size configyaml-0.1.0-py2.py3-none-any.whl (12.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size configyaml-0.1.0.tar.gz (12.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page