SOPS extension for pydantic-settings
Project description
pydantic-settings-sops
SOPS extension for pydantic-settings.
This package allows you to read SOPS files into a pydantic-settings object.
You can install this package via
pip install pydantic-settings-sops
# or
pixi add pydantic-settings-sops
Example
To use pydantic-settings-sops, adjust your settings sources by defining a custom settings_customise_sources.
For more information on pydantic-settings, please visit the official documentation.
from pydantic_settings import (
BaseSettings,
PydanticBaseSettingsSource,
SettingsConfigDict,
)
from pydantic_settings_sops import SOPSConfigSettingsSource
class SettingsExample(BaseSettings):
model_config = SettingsConfigDict(
yaml_file="secrets.yaml"
)
foobar: str
@classmethod
def settings_customise_sources(
cls,
settings_cls: BaseSettings,
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> tuple[PydanticBaseSettingsSource, ...]:
return (init_settings, SOPSConfigSettingsSource(settings_cls))
Installation
This project is managed by pixi. You can install the package in development mode using:
git clone https://github.com/pavelzw/pydantic-settings-sops
cd pydantic-settings-sops
pixi run pre-commit-install
pixi run postinstall
pixi run test
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_sops-0.1.2.tar.gz.
File metadata
- Download URL: pydantic_settings_sops-0.1.2.tar.gz
- Upload date:
- Size: 57.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d03ea8233cec696b4737563947bc668a7cd4a2773252b40948f850784d718cd
|
|
| MD5 |
ec0c0e6bfb8f90b932d5dedbfc8f6f0a
|
|
| BLAKE2b-256 |
047be45527771f7f92a1a31bd569a3b092c70ba33b50e8bf7dc18189e8e74057
|
Provenance
The following attestation bundles were made for pydantic_settings_sops-0.1.2.tar.gz:
Publisher:
build.yml on pavelzw/pydantic-settings-sops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_settings_sops-0.1.2.tar.gz -
Subject digest:
8d03ea8233cec696b4737563947bc668a7cd4a2773252b40948f850784d718cd - Sigstore transparency entry: 212910358
- Sigstore integration time:
-
Permalink:
pavelzw/pydantic-settings-sops@be23c41786fdcb4df9fcd8778a753847e6e28104 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pavelzw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@be23c41786fdcb4df9fcd8778a753847e6e28104 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydantic_settings_sops-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pydantic_settings_sops-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.9 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 |
0e13d68d2630921d4ba1b45806b26d4a38a5bdc8880dba41d439591d331ce903
|
|
| MD5 |
ded1dc462d374c20aede18eccad38942
|
|
| BLAKE2b-256 |
deebadb8bb3873f4925b3c0c6c223b356ae51303cc9a2068f4f40e9a1d118cbe
|
Provenance
The following attestation bundles were made for pydantic_settings_sops-0.1.2-py3-none-any.whl:
Publisher:
build.yml on pavelzw/pydantic-settings-sops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_settings_sops-0.1.2-py3-none-any.whl -
Subject digest:
0e13d68d2630921d4ba1b45806b26d4a38a5bdc8880dba41d439591d331ce903 - Sigstore transparency entry: 212910363
- Sigstore integration time:
-
Permalink:
pavelzw/pydantic-settings-sops@be23c41786fdcb4df9fcd8778a753847e6e28104 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pavelzw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@be23c41786fdcb4df9fcd8778a753847e6e28104 -
Trigger Event:
push
-
Statement type: