Metadata-Version: 2.0
Name: configyaml
Version: 0.2.0
Summary: A config loading and parsing package
Home-page: https://github.com/dropseedlabs/config-loader
Author: Dropseed
Author-email: python@dropseed.io
License: MIT license
Keywords: configyaml
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: Click (>=6.0)
Requires-Dist: pyyaml

configyaml
==========
.. image:: https://travis-ci.org/dropseedlabs/configyaml.svg?branch=master
   :target: https://travis-ci.org/dropseedlabs/configyaml

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

You need a loader:

.. code-block:: python

    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:

.. code-block:: python

    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:

.. code-block:: python

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



=======
History
=======

0.2.0 (2017-04-05)
------------------

* Cleanup package release tooling and documentation
* Fix a bit of broken documentation
* Start some basic Sphinx documentation for classes


0.1.0 (2017-03-30)
------------------

* First release on PyPI.


