pydantic-conf
Overview
pydantic-conf is a Python library for managing application configuration using Pydantic. It supports
loading configuration from environment variables and allows for custom startup actions.
Installation
To install the package, use:
pip install pydantic-conf
Usage
Defining Configuration
Create a configuration class by inheriting from EnvAppConfig:
from pydantic_conf.config import EnvAppConfig
class MyConfig(EnvAppConfig):
app_name: str
debug: bool = False
Loading Configuration
Load the configuration using the load method:
config = MyConfig.load()
print(config.app_name)
print(config.debug)
Adding Startup Actions
Add startup actions by appending to the STARTUP list:
def startup_action(config):
print(f"Starting up with {config.app_name}")
MyConfig.STARTUP.append(startup_action)
config = MyConfig.load()
License
This project is licensed under the MIT License.
Metadata
Release files for pydantic-conf 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydantic_conf-1.0.2.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydantic_conf-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / pydantic_conf-1.0.2.tar.gz
| Download URL | pydantic_conf-1.0.2.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83705db45210e384d34972485734a3d09acd5cb3d733a5790754cf03c0c0af61
|
|
BLAKE2b-256 checksum How to use checksums |
20b72ec1ac760f0617381a8eae70f2788e37acf511f6b46bb110d8b468b3d9a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.9
|
Release files / pydantic_conf-1.0.2-py3-none-any.whl
| Download URL | pydantic_conf-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20c292dc3db8799c4bf17245756eb92e4106d8db00e365f39c1d959cbc39ba64
|
|
BLAKE2b-256 checksum How to use checksums |
0b2d139a78d572456d6bf15015168c089407d7ddfb1a381c4389ca1bce00a3e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.9
|