{"id":28956906,"url":"https://github.com/developmentseed/pydantic-ssm-settings","last_synced_at":"2025-06-23T21:41:12.098Z","repository":{"id":37245457,"uuid":"404118893","full_name":"developmentseed/pydantic-ssm-settings","owner":"developmentseed","description":"Replace Pydantic's builtin Secret Support with a configuration provider that loads parameters from AWS Systems Manager Parameter Store.","archived":false,"fork":false,"pushed_at":"2023-12-29T12:15:20.000Z","size":186,"stargazers_count":18,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-25T12:21:43.368Z","etag":null,"topics":["aws","parameter-store","pydantic","python","ssm"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pydantic-ssm-settings/","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/developmentseed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-09-07T20:49:37.000Z","updated_at":"2023-12-19T05:21:28.000Z","dependencies_parsed_at":"2022-09-15T08:20:54.665Z","dependency_job_id":"b8cf1599-20a6-466a-a23d-f73e74c53539","html_url":"https://github.com/developmentseed/pydantic-ssm-settings","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/pydantic-ssm-settings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fpydantic-ssm-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fpydantic-ssm-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fpydantic-ssm-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fpydantic-ssm-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/pydantic-ssm-settings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fpydantic-ssm-settings/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561246,"owners_count":23177557,"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":["aws","parameter-store","pydantic","python","ssm"],"created_at":"2025-06-23T21:41:11.151Z","updated_at":"2025-06-23T21:41:12.077Z","avatar_url":"https://github.com/developmentseed.png","language":"Python","readme":"# pydantic-ssm-settings\n\nIntegrate [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) with [Pydantic Settings](https://github.com/pydantic/pydantic-settings).\n\n## Usage\n\nThe simplest way to use this module is to inhert your settings from `SsmBaseSettings`. This add the `SsmSettingsSource` as a custom settings source and enabled passing source configuration (e.g. `_ssm_prefix`, `_ssm_client`) via `kwargs` when initializing a settings class.\n\n```py\nfrom pydantic_ssm_settings import SsmBaseSettings\n\n\nclass WebserviceSettings(SsmBaseSettings):\n    some_val: str\n    another_val: int\n\nWebserviceSettings(_ssm_prefix=\"/prod/webservice\")\n```\n\nAlternatively, configuration may be specified within the settings class via [`BaseModel.model_config`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_config):\n\n```py\nfrom pydantic_ssm_settings import SsmSettingsConfigDict\n\nclass WebserviceSettings(SsmBaseSettings):\n    model_config = SsmSettingsConfigDict(ssm_prefix=\"/prod/webservice\")\n    some_val: str\n    another_val: int\n\n\nWebserviceSettings()\n```\n\nIf it is preferred to avoid altering the baseclass of a settings model, the source can be manually added and configured as such:\n\n```py\nfrom typing import Tuple, Type\nfrom pydantic_settings import (\n    BaseSettings,\n    EnvSettingsSource,\n    InitSettingsSource,\n    PydanticBaseSettingsSource,\n    SecretsSettingsSource,\n)\nfrom pydantic_ssm_settings import SsmSettingsConfigDict, SsmSettingsSource\n\nclass WebserviceSettings(BaseSettings):\n    model_config = SsmSettingsConfigDict(ssm_prefix=\"/asdf\")\n    foo: str\n\n    def settings_customise_sources(\n        self,\n        settings_cls: Type[BaseSettings],\n        init_settings: InitSettingsSource,\n        env_settings: EnvSettingsSource,\n        dotenv_settings: PydanticBaseSettingsSource,\n        file_secret_settings: SecretsSettingsSource,\n    ) -\u003e Tuple[PydanticBaseSettingsSource, ...]:\n        return (\n            init_settings,\n            env_settings,\n            dotenv_settings,\n            file_secret_settings,\n            SsmSettingsSource(settings_cls),\n        )\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fpydantic-ssm-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fpydantic-ssm-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fpydantic-ssm-settings/lists"}