pydanticutils
Pydantic utility helpers
Usage
- Install the package from pypi
> pip install pydanticutils
- Create a pydantic settings class
class DatabaseSettings(BaseModel):
host: str = Field(default="0.0.0.0")
port: int = Field(default=5432)
class AppSettings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="APP_", env_nested_delimiter="__")
log_level: str = Field(default="INFO")
database: DatabaseSettings = Field(default_factory=DatabaseSettings)
- Read a configuration file into the settings class
from pydanticutils import read_yaml
settings = read_yaml("/path/to/config.yaml", AppSettings)
Development
This repository manages the dev environment as a Nix flake and requires Nix to be installed
> nix develop -c $SHELL
> make setup
> make test
Publish Package to PyPi
> make distribution
License
pydanticutils is released under the MIT license
Metadata
Release files for pydanticutils 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydanticutils-0.0.3.tar.gz | 4.0 kB | Without provenance | Details for pydanticutils-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydanticutils-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pydanticutils-0.0.3-py3-none-any.whl |
Total release size: 8.0 kB
Release files / pydanticutils-0.0.3.tar.gz
| Download URL | pydanticutils-0.0.3.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cdba917b940d555eca6157c8988fdac5185a6ec1bbb58d11a5e5b79fa3f84b7
|
|
BLAKE2b-256 checksum How to use checksums |
9e4d58506f95317ee045cf4dc9178fe18c6e944061593a4723a3f3bb6fd1f1cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.9
|
Release files / pydanticutils-0.0.3-py3-none-any.whl
| Download URL | pydanticutils-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13de2540373a42500ea8a889b710da3a3a1250048967b1a048beda9ce7c5f116
|
|
BLAKE2b-256 checksum How to use checksums |
27793e9385cc5b220667b4dc7a4b12ac9877e91491a8862bc86ad3cd80740438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.9
|
Security for pydanticutils 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.