Skip to main content

PyDantic Settings External is a library that extends PyDantic Settings to support various types of external configuration providers, such as GCP Secret Manager and AWS Secrets Manager. PyDantic Settings External has been developed using a clear abstraction, allowing for easy extension to external configurations not yet incorporated into the library by the community.

Project description

Pydantic Settings External

The project is currently under active development.

Pydantic Settings External extends Pydantic Settings to support various types of external configuration providers, such as GCP Secret Manager and AWS Secrets Manager. PyDantic Settings External has been developed using a clear abstraction, allowing for easy extension to external providers.

Installation:

pip install pydantic-settings-external

Usage example with with_settings_external helper

Pydantic v2.x

pip install pydantic
pip install pydantic-settings-external
pip install pydantic-settings
from pydantic import Field
from pydantic_settings_external import BaseSettings


gcp = GCPProvider(...)
one_password = OnePasswordProvider(...)


class Settings(BaseSettings):
    SENDGRID_API_KEY: str = Field(..., json_schema_extra={
        "provider": {
            "instance": gcp,
            "options": {"name": "sendgrid-api-key", "vesion": "latest"},
            "hint": "The optional hint will be displayed if the secret couldn't be retrieved for any reason.",
        },
    })
    ADMIN_USER: str = Field(..., json_schema_extra={
        "provider": {
            "instance": one_password,
            "options": {"field": "user", "vault": "admin_credentials"},
        },
    })

settings = Settings()

Pydantic v1.10.x

pip install "pydantic>=1.10,<2"
pip install pydantic-settings-external

NOTE: For Pydantic v1.10.x replace json_schema_extra with extra.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic-settings-external-0.1.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page