{"id":28748206,"url":"https://github.com/dribia/driconfig","last_synced_at":"2026-02-16T12:14:02.565Z","repository":{"id":57424147,"uuid":"410791810","full_name":"dribia/driconfig","owner":"dribia","description":"Pydantic-ish YAML configuration management.","archived":false,"fork":false,"pushed_at":"2025-06-10T09:50:35.000Z","size":2441,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-12T16:16:00.820Z","etag":null,"topics":["config","configuration","parsing","pydantic","python","validation","yaml","yaml-config","yaml-parser"],"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/dribia.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-27T07:53:47.000Z","updated_at":"2025-06-10T09:50:37.000Z","dependencies_parsed_at":"2022-09-14T08:51:25.258Z","dependency_job_id":"385fa92a-53fe-46d2-832b-7783f1ab68c9","html_url":"https://github.com/dribia/driconfig","commit_stats":{"total_commits":124,"total_committers":3,"mean_commits":"41.333333333333336","dds":"0.45967741935483875","last_synced_commit":"506aa46360ded11c9d3bc34ae99839ca8096db1f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/dribia/driconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dribia%2Fdriconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dribia%2Fdriconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dribia%2Fdriconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dribia%2Fdriconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dribia","download_url":"https://codeload.github.com/dribia/driconfig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dribia%2Fdriconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260212046,"owners_count":22975478,"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","configuration","parsing","pydantic","python","validation","yaml","yaml-config","yaml-parser"],"created_at":"2025-06-16T18:01:25.546Z","updated_at":"2026-02-16T12:14:02.559Z","avatar_url":"https://github.com/dribia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DriConfig\n==========================\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://dribia.github.io/driconfig\"\u003e\n        \u003cpicture style=\"display: block; margin-left: auto; margin-right: auto; width: 40%;\"\u003e\n            \u003csource\n                media=\"(prefers-color-scheme: dark)\"\n                srcset=\"https://dribia.github.io/driconfig/img/logo_dribia_blanc_cropped.png\"\n            \u003e\n            \u003csource\n                media=\"(prefers-color-scheme: light)\"\n                srcset=\"https://dribia.github.io/driconfig/img/logo_dribia_blau_cropped.png\"\n            \u003e\n            \u003cimg\n                alt=\"driconfig\"\n                src=\"https://dribia.github.io/driconfig/img/logo_dribia_blau_cropped.png\"\n            \u003e\n        \u003c/picture\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eA Pydantic-ish way to manage your project's YAML configurations.\u003c/em\u003e\n\u003c/p\u003e\n\n|         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| CI/CD   | [![Lint](https://github.com/dribia/driconfig/workflows/Lint/badge.svg?query=branch%3Amain)](https://github.com/dribia/driconfig/actions?query=workflow%3ALint) [![Tests](https://github.com/dribia/driconfig/workflows/Test/badge.svg?query=branch%3Amain)](https://github.com/dribia/driconfig/actions?query=workflow%3ATest) [![Coverage Status](https://img.shields.io/codecov/c/github/dribia/driconfig?color=%2334D058)](https://codecov.io/gh/dribia/driconfig) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://docs.astral.sh/ty/) |\n| Package | [![PyPI](https://img.shields.io/pypi/v/driconfig)](https://pypi.org/project/driconfig) ![PyPI - Downloads](https://img.shields.io/pypi/dm/driconfig) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/driconfig) [![GitHub](https://img.shields.io/github/license/dribia/driconfig)](LICENSE)                                                                                                                                                                                                                                              |\n\n---\n\n**Documentation**: \u003ca href=\"https://dribia.github.io/driconfig\" target=\"_blank\"\u003ehttps://dribia.github.io/driconfig\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/dribia/driconfig\" target=\"_blank\"\u003ehttps://github.com/dribia/driconfig\u003c/a\u003e\n\n---\n\nThe usage of YAML files to store configurations and parameters is widely accepted in the Python\ncommunity, especially in Data Science environments. DriConfig provides a clean interface between your\nPython code and these YAML configuration files.\n\nIt is heavily based on [Pydantic](https://pydantic-docs.helpmanual.io)'s\n[Settings Management](https://pydantic-docs.helpmanual.io/usage/settings/),\npreserving its core functionalities and advantages.\n\n## Key features\n\n* Subclassing the `DriConfig` class we create an **interface to any YAML configuration file**.\n* Our project's **configurations are** then **attributes** of this class.\n* They are **automatically filled** with the values in the YAML configuration file.\n* We can define **complex configuration structures** using Pydantic models.\n* We preserve Pydantic's **type casting and validation**!\n\n## Installation\n\nThis project resides in the Python Package Index (PyPI), so it can easily be installed with `uv` or `pip`.\n\n### Using uv (recommended)\n\n[uv](https://docs.astral.sh/uv/) is a fast Python package installer and resolver.\n\n```console\nuv pip install driconfig\n```\n\nOr add it to your project:\n\n```console\nuv add driconfig\n```\n\n### Using pip\n\n```console\npip install driconfig\n```\n\n## Usage\n\nYou can import the `DriConfig` class from the `driconfig` package and create your own configuration classes.\n\n```python\nfrom driconfig import DriConfig\n```\n\n### Examples\n\nLet's say we have a YAML configuration file `config.yaml` with the following data:\n```yaml\n# config.yaml\nmodel_parameters:\n  eta: 0.2\n  gamma: 2\n  lambda: 1\n\ndate_interval:\n  start: 2021-01-01\n  end: 2021-12-31\n```\nThen we can configparse with `driconfig` as follows:\n```python\nfrom datetime import date\nfrom typing import Dict\n\nfrom driconfig import DriConfig, DriConfigConfigDict\nfrom pydantic import BaseModel\n\n\nclass DateInterval(BaseModel):\n  \"\"\"Model for the `date_interval` configuration.\"\"\"\n  start: date\n  end: date\n\n\nclass AppConfig(DriConfig):\n   \"\"\"Interface for the config/config.yaml file.\"\"\"\n\n    \"\"\"Configure the YAML file location.\"\"\"\n    model_config = DriConfigConfigDict(\n        config_folder=\".\",\n        config_file_name=\"config.yaml\",\n    )\n   model_parameters: Dict[str, float]\n   date_interval: DateInterval\n\nconfig = AppConfig()\nprint(config.model_dump_json(indent=4))\n\"\"\"\n{\n    \"model_parameters\": {\n        \"eta\": 0.2,\n        \"gamma\": 2.0,\n        \"lambda\": 1.0\n    },\n    \"date_interval\": {\n        \"start\": \"2021-01-01\",\n        \"end\": \"2021-12-31\"\n    }\n}\n\"\"\"\n```\n\n## Contributing\n\nCheck the [CONTRIBUTING](./CONTRIBUTING.md) site for guidelines on how to contribute to this project.\n\n## License\n\nDriConfig is distributed under the terms of the [MIT](https://opensource.org/license/mit) license.\nCheck the [LICENSE](./LICENSE) file for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdribia%2Fdriconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdribia%2Fdriconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdribia%2Fdriconfig/lists"}