{"id":13448142,"url":"https://github.com/dropseed/configyaml","last_synced_at":"2025-12-14T03:54:27.675Z","repository":{"id":62564440,"uuid":"84390604","full_name":"dropseed/configyaml","owner":"dropseed","description":"Parse and validate YAML config files using Python classes","archived":true,"fork":false,"pushed_at":"2019-09-02T15:53:37.000Z","size":106,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T01:26:48.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropseed.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T02:50:30.000Z","updated_at":"2023-01-28T08:22:52.000Z","dependencies_parsed_at":"2022-11-03T16:00:40.290Z","dependency_job_id":null,"html_url":"https://github.com/dropseed/configyaml","commit_stats":null,"previous_names":["dropseedlabs/config-loader"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fconfigyaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fconfigyaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fconfigyaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fconfigyaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropseed","download_url":"https://codeload.github.com/dropseed/configyaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931482,"owners_count":20534008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:36.878Z","updated_at":"2025-12-14T03:54:22.617Z","avatar_url":"https://github.com/dropseed.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"configyaml\n==========\n\n.. image:: https://travis-ci.org/dropseedlabs/configyaml.svg?branch=master\n    :target: https://travis-ci.org/dropseedlabs/configyaml\n\n.. image:: https://img.shields.io/pypi/v/configyaml.svg\n    :target: https://pypi.python.org/pypi/configyaml\n\n.. image:: https://img.shields.io/pypi/l/configyaml.svg\n    :target: https://pypi.python.org/pypi/configyaml\n\n.. image:: https://img.shields.io/pypi/pyversions/configyaml.svg\n    :target: https://pypi.python.org/pypi/configyaml\n    \n\nUsage\n-----\nThe basic usage pattern is to extend these classes to create your own.\n\nYou need a loader:\n\n.. code-block:: python\n\n    from configyaml import loader\n\n    from .config.root import Root\n\n    class SibbellConfigLoader(loader.ConfigLoader):\n        config_root_class = Root\n\n\nThen design your config using additional classes. You need at least 1 to serve as the root class:\n\n.. code-block:: python\n\n    from configyaml.config import DictNode\n    from .dependencies import Dependencies\n    from .notifications import Notifications\n\n\n    class Root(DictNode):\n        \"\"\"Root of the yaml file\"\"\"\n\n        def __init__(self, *args, **kwargs):\n            self._dict_fields = {\n                        'dependencies': {\n                            'class': Dependencies,\n                            'required': True,\n                            'default': [],\n                        },\n                        'notifications': {\n                            'class': Notifications,\n                            'required': True,  # no point right now if no notifications\n                            'default': [],\n                        }\n                    }\n            super(Root, self).__init__(*args, **kwargs)\n\n        def _context_to_inject(self):\n            \"\"\"Make dependencies list available to notifcations\"\"\"\n            return {'dependencies': self.dependencies}\n\nThen to use it, simply create a loader using the configuration text content:\n\n.. code-block:: python\n\n    loader = SibbellConfigLoader(yaml_text)\n    # can now access the configuration and any other properties/method added to their classes\n    loader.is_valid()\n    loader.errors\n    loader.config_root.dependencies\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropseed%2Fconfigyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropseed%2Fconfigyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropseed%2Fconfigyaml/lists"}