{"id":23819775,"url":"https://github.com/stefanofusai/pyamldantic","last_synced_at":"2025-09-07T02:30:45.071Z","repository":{"id":257805847,"uuid":"865309654","full_name":"stefanofusai/pyamldantic","owner":"stefanofusai","description":"Validate and serialize YAML config files with Pydantic","archived":false,"fork":false,"pushed_at":"2024-12-28T01:46:58.000Z","size":90,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T02:24:13.273Z","etag":null,"topics":["pydantic","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/stefanofusai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-09-30T10:21:12.000Z","updated_at":"2024-12-28T01:46:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"05e5f6ef-dc6b-40e1-b5e8-f61785f0fbfa","html_url":"https://github.com/stefanofusai/pyamldantic","commit_stats":null,"previous_names":["stefanofusai/pyamldantic"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanofusai%2Fpyamldantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanofusai%2Fpyamldantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanofusai%2Fpyamldantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanofusai%2Fpyamldantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanofusai","download_url":"https://codeload.github.com/stefanofusai/pyamldantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232163094,"owners_count":18481581,"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":["pydantic","yaml"],"created_at":"2025-01-02T07:15:10.549Z","updated_at":"2025-09-07T02:30:45.062Z","avatar_url":"https://github.com/stefanofusai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyamldantic\n\nValidate and serialize YAML config files with Pydantic, with support for environment variables.\n\nThis package uses [uv](https://docs.astral.sh/uv/) for project management. To get started, make sure that **uv** is installed on your machine and updated to the latest version. Detailed installation instructions for **uv** can be found [here](https://docs.astral.sh/uv/getting-started/installation/).\n\n## Installation\n\n```bash\nuv add pyamldantic\n```\n\n## Usage\n\n`config.yaml`\n\n```yaml\ndatabase:\n  host: $DATABASE_HOST\n  name: $DATABASE_NAME\n  password: $DATABASE_PASSWORD\n  port: $DATABASE_PORT\n  user: $DATABASE_USER\n  timeout: $DATABASE_TIMEOUT?\nenvironment: development\nis_debug: true\n```\n\n`config.py`\n\n```python\nfrom pyamldantic import YAMLConfig\nfrom pydantic import BaseModel, SecretStr\n\nclass DatabaseSchema(BaseModel):\n    host: str\n    name: str\n    password: SecretStr\n    port: int\n    user: str\n    ssl: bool = False\n    timeout: int | None = None\n\nclass Schema(BaseModel):\n    database: DatabaseSchema\n    environment: str\n    is_debug: bool\n\nconfig = YAMLConfig.load(\"config.yaml\", schema=Schema)\n```\n\n`main.py`\n\n```python\nfrom .config import config\n\nif __name__ == \"__main__\":\n    print(f\"Initializing {config.environment} environment...\")\n    ...\n```\n\n## Development\n\n```bash\nuv sync --frozen --group=development\nuv run --frozen pre-commit install --install-hooks\nuv run --frozen pre-commit install --hook-type=commit-msg\n```\n\n## Testing\n\n```bash\nuv sync --frozen --group=testing\nuv run --frozen pytest\n```\n\n## Acknowledgments\n\nThis project was inspired by [envyaml](https://github.com/thesimj/envyaml).\n\n## Contributing\n\nContributions are welcome! To get started, please refer to our [contribution guidelines](https://github.com/stefanofusai/pyamldantic/blob/main/CONTRIBUTING.md).\n\n## Issues\n\nIf you encounter any problems while using this package, please open a new issue [here](https://github.com/stefanofusai/pyamldantic/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanofusai%2Fpyamldantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanofusai%2Fpyamldantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanofusai%2Fpyamldantic/lists"}