Skip to main content

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.

Metadata

Release files for pydantic-settings-external 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-settings-external 0.1.0
File Size Uploaded
pydantic-settings-external-0.1.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-settings-external 0.1.0
File Interpreter ABI Platform
pydantic_settings_external-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / pydantic-settings-external-0.1.0.tar.gz

Download URL pydantic-settings-external-0.1.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
da31a4914cda2b5fbd15873f0e8287f7b38347087537299737608f4d28d33508
BLAKE2b-256 checksum
How to use checksums
553c529c9f1391a61c8720e7e8af8f14b84378c459299fbd1386221b5809f5b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / pydantic_settings_external-0.1.0-py3-none-any.whl

Download URL pydantic_settings_external-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86166e2b1bc406879f7e97a8d30ad6573fbd4107bd1ebe3b36a483909c3a4a0c
BLAKE2b-256 checksum
How to use checksums
954089005ca101e2bbbf8260d8f29f416345918e497936a658f26826ea27e0cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page