{"id":24746642,"url":"https://github.com/samuelmarks/py-typed-settings","last_synced_at":"2026-04-26T16:31:38.856Z","repository":{"id":59266183,"uuid":"536311506","full_name":"SamuelMarks/py-typed-settings","owner":"SamuelMarks","description":"Generate typed settings.py from settings.yaml in Python 2, 3","archived":false,"fork":false,"pushed_at":"2022-09-21T02:40:08.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T01:28:03.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamuelMarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-13T21:16:25.000Z","updated_at":"2022-09-13T22:56:07.000Z","dependencies_parsed_at":"2023-01-18T17:16:36.287Z","dependency_job_id":null,"html_url":"https://github.com/SamuelMarks/py-typed-settings","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SamuelMarks/py-typed-settings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fpy-typed-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fpy-typed-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fpy-typed-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fpy-typed-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelMarks","download_url":"https://codeload.github.com/SamuelMarks/py-typed-settings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fpy-typed-settings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-01-28T04:29:45.717Z","updated_at":"2026-04-26T16:31:38.843Z","avatar_url":"https://github.com/SamuelMarks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"py_typed_settings\n=================\n![Python version range](https://img.shields.io/badge/python-2.7%20|%203.6%20|%203.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11.0b5-blue.svg)\n[![License](https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nGenerate typed settings.py from settings.yaml in Python 2, 3.\n\nUseful for fully type-safe settings, with code-completion. E.g., `import settings; print(settings.AWS.bucket.value)`\n\n## Command-line usage\n\n```shell\n$ python -m py_typed_settings --help\nusage: py_typed_settings [-h] [--version] -i INPUT_YAML -o OUTPUT_PY\n                         [-n NAMESPACE]\n\nGenerate typed settings.py from settings.yaml in Python 2, 3\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -i INPUT_YAML, --input-yaml INPUT_YAML\n                        settings.yaml (input) filepath\n  -o OUTPUT_PY, --output-py OUTPUT_PY\n                        settings.py (output) filepath\n  -n NAMESPACE, --namespace NAMESPACE\n                        Environment variable to change `tier`\n```\n\n### Example\n```shell\npython -m py_typed_settings -i py_typed_settings/_data/settings.yaml -o py_typed_settings/settings_gen.py\n```\n\n## Example YAML input\n\n```yaml\nconstants:\n  - name: cors_origin\n    dev:\n      origins:\n        - 'http://localhost:8080'\n        - '*'\n    remote-dev:\n      origins:\n        - 'https://api-dev.example.com'\n    prod:\n      origins:\n        - 'https://api.example.com'\n\nproviders:\n  - provider: aws\n    dev:\n      bucket:\n        value: bucket-dev\n    remote-dev:\n      bucket:\n        value: bucket-dev\n    prod:\n      bucket:\n        value: bucket-prod\n```\n\n## Example output (Python 2.7)\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# GENERATED! Do not manually edit. Modify 'settings.yaml' instead (then run `./settings_schema_gen.py`)\n# (different tiers can be targeted with this script by setting the `TIER` env var; defaults to 'dev')\n\nfrom typing import List, Tuple, Union\n\n\n#############\n# Providers #\n#############\n\n\nclass AWS(object):\n    class bucket(object):\n        value = 'bucket-dev'  # type: str\n\n\n#############\n# Constants #\n#############\n\n\nclass CORS_ORIGIN(object):\n    origins = 'http://localhost:8080', '*'  # type: Tuple[str]\n\n\n__all__ = ['AWS', 'CORS_ORIGIN']  # type: List[str]\n```\n\n## Example output (Python 3)\n\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# GENERATED! Do not manually edit. Modify 'settings.yaml' instead (then run `./settings_schema_gen.py`)\n# (different tiers can be targeted with this script by setting the `TIER` env var; defaults to 'dev')\n\nfrom typing import List, Tuple, Union\n\n\n#############\n# Providers #\n#############\n\n\nclass AWS(object):\n    class bucket(object):\n        value: str = 'bucket-dev'\n\n\n#############\n# Constants #\n#############\n\n\nclass CORS_ORIGIN(object):\n    origins: Tuple[str] = ('http://localhost:8080', '*')\n\n\n__all__: List[str] = ['AWS', 'CORS_ORIGIN']\n```\n\n## Developer\n\n### Install dependencies\n\n    python -m pip install -r requirements.txt\n\n### Install package\n\n    python -m pip install .\n\n## End user\n\n    python -m pip install https://api.github.com/repos/SamuelMarks/py-typed-settings/zipball#egg=py_typed_settings\n\n---\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Fpy-typed-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmarks%2Fpy-typed-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Fpy-typed-settings/lists"}