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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pydantic-settings-external-0.1.0.tar.gz
.
File metadata
- Download URL: pydantic-settings-external-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da31a4914cda2b5fbd15873f0e8287f7b38347087537299737608f4d28d33508 |
|
MD5 | dff2e821b8690c61e53aa74e642f72dd |
|
BLAKE2b-256 | 553c529c9f1391a61c8720e7e8af8f14b84378c459299fbd1386221b5809f5b1 |
File details
Details for the file pydantic_settings_external-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydantic_settings_external-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86166e2b1bc406879f7e97a8d30ad6573fbd4107bd1ebe3b36a483909c3a4a0c |
|
MD5 | eb358d80f8e3b4cc3d6fe6a7cbc440b5 |
|
BLAKE2b-256 | 954089005ca101e2bbbf8260d8f29f416345918e497936a658f26826ea27e0cf |