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 details)

Uploaded Source

Built Distribution

File details

Details for the file pydantic-settings-external-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pydantic-settings-external-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da31a4914cda2b5fbd15873f0e8287f7b38347087537299737608f4d28d33508
MD5 dff2e821b8690c61e53aa74e642f72dd
BLAKE2b-256 553c529c9f1391a61c8720e7e8af8f14b84378c459299fbd1386221b5809f5b1

See more details on using hashes here.

File details

Details for the file pydantic_settings_external-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_settings_external-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86166e2b1bc406879f7e97a8d30ad6573fbd4107bd1ebe3b36a483909c3a4a0c
MD5 eb358d80f8e3b4cc3d6fe6a7cbc440b5
BLAKE2b-256 954089005ca101e2bbbf8260d8f29f416345918e497936a658f26826ea27e0cf

See more details on using hashes here.

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