A simple library to map YAML data into Python dataclasses
Project description
yaml-dataclass
A simple Python library for mapping YAML data to Python dataclasses.
Installation
pip install yaml-pydantic-dataclass
Usage
# config.yaml
app:
port: 8080
debug: false
from pydantic.dataclasses import dataclass
from yaml_pydantic_dataclass import YamlConfig
@dataclass
class AppConfig(YamlConfig):
__path__ = "app"
__config_file__ = "./config.yaml"
port: int
debug: bool
if __name__ == '__main__':
config = AppConfig.read_config()
print(config.port) # 8080
print(config.debug) # False
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 yaml_pydantic_dataclass-0.1.1.tar.gz.
File metadata
- Download URL: yaml_pydantic_dataclass-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0462fb5a8e71eff9ba913e37fe2bb209985365690ce425d0712812606f7d31b1
|
|
| MD5 |
8528d1053a36e105af038796254c8d3f
|
|
| BLAKE2b-256 |
c3c84376e0232ebc3ed8ea40f5d1a2baceea684ae97a718b10f7711c772a2df9
|
Provenance
The following attestation bundles were made for yaml_pydantic_dataclass-0.1.1.tar.gz:
Publisher:
python-publish.yml on atrivisc/yaml-pydantic-dataclass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaml_pydantic_dataclass-0.1.1.tar.gz -
Subject digest:
0462fb5a8e71eff9ba913e37fe2bb209985365690ce425d0712812606f7d31b1 - Sigstore transparency entry: 1008591079
- Sigstore integration time:
-
Permalink:
atrivisc/yaml-pydantic-dataclass@65ac60e85c80efd38bf0d4f2d3b413a6a8538216 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/atrivisc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65ac60e85c80efd38bf0d4f2d3b413a6a8538216 -
Trigger Event:
release
-
Statement type:
File details
Details for the file yaml_pydantic_dataclass-0.1.1-py3-none-any.whl.
File metadata
- Download URL: yaml_pydantic_dataclass-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec75cbd08692bfd45f36651e8748c01268d56560e2940a3c932f4834ec7cea5
|
|
| MD5 |
aaf6a5ffc289bb96017bed7e0db1bada
|
|
| BLAKE2b-256 |
e376a7883581c8c4023c601048852160a5568a51956f78920f8272f9fa608d42
|
Provenance
The following attestation bundles were made for yaml_pydantic_dataclass-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on atrivisc/yaml-pydantic-dataclass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaml_pydantic_dataclass-0.1.1-py3-none-any.whl -
Subject digest:
9ec75cbd08692bfd45f36651e8748c01268d56560e2940a3c932f4834ec7cea5 - Sigstore transparency entry: 1008591096
- Sigstore integration time:
-
Permalink:
atrivisc/yaml-pydantic-dataclass@65ac60e85c80efd38bf0d4f2d3b413a6a8538216 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/atrivisc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@65ac60e85c80efd38bf0d4f2d3b413a6a8538216 -
Trigger Event:
release
-
Statement type: