{"id":15089136,"url":"https://github.com/crxwns/hiraconf","last_synced_at":"2026-01-25T13:31:38.692Z","repository":{"id":253296226,"uuid":"843072485","full_name":"crxwns/HiraConf","owner":"crxwns","description":"Hierarchical config parser","archived":false,"fork":false,"pushed_at":"2024-08-23T18:10:43.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T10:11:45.534Z","etag":null,"topics":["config","hierarchical","toml","yaml"],"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/crxwns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T18:12:06.000Z","updated_at":"2024-08-23T18:09:08.000Z","dependencies_parsed_at":"2024-09-29T23:00:41.283Z","dependency_job_id":"dd73ef3c-f9c5-4bab-828c-d49c71c9d483","html_url":"https://github.com/crxwns/HiraConf","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"9c226ece281f73958c72496842862bd2c6bd8a71"},"previous_names":["crxwns/hiraconf"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crxwns%2FHiraConf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crxwns%2FHiraConf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crxwns%2FHiraConf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crxwns%2FHiraConf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crxwns","download_url":"https://codeload.github.com/crxwns/HiraConf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239785294,"owners_count":19696749,"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":["config","hierarchical","toml","yaml"],"created_at":"2024-09-25T08:41:02.344Z","updated_at":"2026-01-25T13:31:38.652Z","avatar_url":"https://github.com/crxwns.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HiraConf\n\nA hierarchical parser for configurations, allowing to merge or join configurations from multiple sources.\n\n# Example\n\nUsing Pydantic for extracting the parsed configuration in this example, which is optional. You can also access the `data` property\nto directly access the dictionary.\n\n\n```python\nfrom pydantic import BaseModel\n\nfrom hiraconf.parser import Parser\nfrom hiraconf.provider import TomlStringProvider, YamlStringProvider\n\n\n# Create the BaseModels for validation of configuration\nclass Settings(BaseModel):\n    debug: bool\n    version: str\n    new: int | None = None\n\n\nclass Config(BaseModel):\n    settings: Settings\n\n\n# Define your config as file, env, string, toml, yaml or any provider that implements the Provider ABC\n\nyaml_settings = \"\"\"settings:\n  debug: true\n  version: 1.0.0\n  \"\"\"\n\nparsed_yaml = Parser().merge(YamlStringProvider(yaml_string=yaml_settings)).extract(Config)\n\nprint(parsed_yaml)\n# \u003e\u003e\u003e settings=Settings(debug=False, version='1.0.0', new=None)\n\n# If you have multiple configs and want to merge those, you can. Like overwriting the debug setting.\n\ntoml_settings = \"\"\"[settings]\ndebug = false\n\"\"\"\n\nparsed_merged = (\n    Parser()\n    .merge(YamlStringProvider(yaml_string=yaml_settings))\n    .merge(TomlStringProvider(toml_string=toml_settings))\n    .extract(Config)\n)\n\nprint(parsed_merged)\n# \u003e\u003e\u003e settings=Settings(debug=False, version='1.0.0', new=None)\n\n# Or you join it and keep the original value if it exists as is\n\ntoml_join_settings = \"\"\"[settings]\ndebug = false\nnew = 10\n\"\"\"\n\nparsed_joined = (\n    Parser()\n    .merge(YamlStringProvider(yaml_string=yaml_settings))\n    .join(TomlStringProvider(toml_string=toml_join_settings))\n    .extract(Config)\n)\n\nprint(parsed_joined)\n# \u003e\u003e\u003e settings=Settings(debug=True, version='1.0.0', new=10)\n```\n\n# Provider\n\nYou can define your own `Provider` by inheriting from `Provider` and implementing the abstract `load(self) -\u003e dict[str, Any]` method.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrxwns%2Fhiraconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrxwns%2Fhiraconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrxwns%2Fhiraconf/lists"}