pydantic loader module.
Project description
PyConfig
Configuration management using pydantic and a bit of sugar.
This library provides a load and save functions to load and save serialized pydantic settings.
Settings can be saved in .json, .yaml and .toml format.
Installation
pip install pydantic_loader for loading and saving json files.
pip install pydantic_loader[yaml] for loading and saving yaml and json files.
pip install pydantic_loader[toml] for loading and saving toml and json.
"""Simple example."""
from pathlib import Path
from pydantic_loader import load_json, save_json
from pydantic import BaseSettings
class DummyConfig(BaseSettings):
"""An app configuration class"""
a: int = 1
b: str = "ABC"
config = DummyConfig()
save_json(config, Path("config.json"))
config = load_json(DummyConfig, Path("config.json"))
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_loader-0.9.1.tar.gz.
File metadata
- Download URL: pydantic_loader-0.9.1.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9964615727c1b035df4417d79c40bf9683540d720115309735ddf0e937cd25f0
|
|
| MD5 |
1d4d8086c532abf5d45a748af497a968
|
|
| BLAKE2b-256 |
db1212c8be756fe77303074379ddc1ba72b2c5925d5b22c7e336398f325a3b08
|
File details
Details for the file pydantic_loader-0.9.1-py3-none-any.whl.
File metadata
- Download URL: pydantic_loader-0.9.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.23.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c3ffe6aca4b52429386c56a224c6ef6fabbfef7ac53d7ba9334c3961b77f1cf
|
|
| MD5 |
fc8ef92d3f5e3bda0a28c3705b9ee8f4
|
|
| BLAKE2b-256 |
7ecd6728b3e5ba0cb60d52f47ee4b0387c87e43735d91f78b4dfe4b8b44a0fae
|