Settings management for Pydantic models using Doppler
Project description
Pydantic Settings Doppler
Pydantic Settings for Doppler integration! This package provides a seamless way to load configuration values from Doppler into your Pydantic models. It leverages the power of Doppler's secrets management and Pydantic's settings management to make your application configuration secure and easy to use.
🚀 Features
- Secure: Fetch secrets directly from Doppler.
- Simple: Integrates seamlessly with Pydantic's
BaseSettings. - Flexible: Supports environment variable fallbacks and default values.
📦 Installation
Install the package using pip:
pip install pydantic-settings-doppler
🛠️ Usage
Here's a quick example to get you started:
from pydantic_settings import BaseSettings
from pydantic_settings.sources import PydanticBaseSettingsSource
from pydantic_settings_doppler import DopplerSettingsSource
class Settings(BaseSettings):
database_url: str
api_key: str
@classmethod
def settings_customise_sources(
cls,
settings_cls: type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> tuple[PydanticBaseSettingsSource, ...]:
return (
init_settings,
DopplerSettingsSource(
settings_cls,
token="your-doppler-token",
project_id="your-project-id",
config_id="your-config-id",
),
env_settings,
dotenv_settings,
file_secret_settings,
)
# Load settings
settings = Settings()
print(settings.database_url)
print(settings.api_key)
📖 Documentation
For more details, check out the Doppler documentation and Pydantic documentation.
🧑💻 Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
⚖️ License
This project is licensed under the MIT License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_settings_doppler-0.1.2.tar.gz.
File metadata
- Download URL: pydantic_settings_doppler-0.1.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09600aeac6ae217af80b40e3f8967ca1b6b018f1f2a8a2e0ab275ac1bbdf3364
|
|
| MD5 |
042b3b5853b5099f7a3ac0998a2166b3
|
|
| BLAKE2b-256 |
ad77988b15da246852e3ea2aba1f4e720f02658fb635913ad1f694791eb8350d
|
Provenance
The following attestation bundles were made for pydantic_settings_doppler-0.1.2.tar.gz:
Publisher:
release.yaml on ajauniskis/pydantic-settings-doppler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_settings_doppler-0.1.2.tar.gz -
Subject digest:
09600aeac6ae217af80b40e3f8967ca1b6b018f1f2a8a2e0ab275ac1bbdf3364 - Sigstore transparency entry: 201615365
- Sigstore integration time:
-
Permalink:
ajauniskis/pydantic-settings-doppler@45e9a27809cfd04bbc095dcdf1fcdf2edc2f275d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ajauniskis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@45e9a27809cfd04bbc095dcdf1fcdf2edc2f275d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydantic_settings_doppler-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pydantic_settings_doppler-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
344e71b44ee27bc0311219ebf4562719f6fbccaee2981bad4716c0f1c30d45b0
|
|
| MD5 |
045e1c41c545e842dd9f65f7edf7c4a7
|
|
| BLAKE2b-256 |
c39eb36bd75f62a08cd4e733f91b7b632aadfc7504766370d0cee1bfc3b70065
|
Provenance
The following attestation bundles were made for pydantic_settings_doppler-0.1.2-py3-none-any.whl:
Publisher:
release.yaml on ajauniskis/pydantic-settings-doppler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_settings_doppler-0.1.2-py3-none-any.whl -
Subject digest:
344e71b44ee27bc0311219ebf4562719f6fbccaee2981bad4716c0f1c30d45b0 - Sigstore transparency entry: 201615366
- Sigstore integration time:
-
Permalink:
ajauniskis/pydantic-settings-doppler@45e9a27809cfd04bbc095dcdf1fcdf2edc2f275d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ajauniskis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@45e9a27809cfd04bbc095dcdf1fcdf2edc2f275d -
Trigger Event:
push
-
Statement type: