Easy Yaml based Configuration for Python
Project description
EYConf
Easy Yaml based Configuration for Python
Features
- Generate: Automatically convert a schema to a yaml configuration file, including comments!
- Validate: Validate a given configuration file against your schema and raise human readable errors!
- Extend: Introduce custom logic by extending the
EYConfclass! - Reload: Reload your configuration on the fly without restarting your application!
Installation
You can install EYConf from PyPI using pip.
pip install eyconf
Example Usage
from dataclasses import dataclass
from eyconf import EYConf
@dataclass
class Transport:
"""Email transport configuration"""
host: str = 'imap.example.com'
port: int = 993
username: str = 'user'
password: str = 'password'
use_ssl: bool = False
@dataclass
class Other:
"""Other configuration options"""
bar: int | None = None
@dataclass
class ConfigSchema:
"""My configuration schema
Docstrings are used as comments in the generated yaml file!
"""
transport: Transport
other: Other
config = EYConf(ConfigSchema)
This generate the following config.yaml file in your current working directory:
# My configuration schema
# Docstrings are used as comments in the generated yaml file!
transport:
# Email transport configuration
host: imap.example.com
port: 993
username: user
password: password
use_ssl: false
other:
# Other configuration options
bar: null
Please refer to the documentation for more information.
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 eyconf-0.1.0.tar.gz.
File metadata
- Download URL: eyconf-0.1.0.tar.gz
- Upload date:
- Size: 91.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21484de09a4d6d94f7e16ef7d7643d8cc7428c33158b24eff3255ee1216d4c4c
|
|
| MD5 |
fcb91a407143ad6dbe9397b0dd7caff1
|
|
| BLAKE2b-256 |
9b9bba17499062408fb18c479f0f813b1cf242a6462f240ada5a04c2f7836875
|
Provenance
The following attestation bundles were made for eyconf-0.1.0.tar.gz:
Publisher:
publish.yml on semohr/eyconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eyconf-0.1.0.tar.gz -
Subject digest:
21484de09a4d6d94f7e16ef7d7643d8cc7428c33158b24eff3255ee1216d4c4c - Sigstore transparency entry: 362716592
- Sigstore integration time:
-
Permalink:
semohr/eyconf@f02642adb16da506db5d18efa72788f3cd770179 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/semohr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f02642adb16da506db5d18efa72788f3cd770179 -
Trigger Event:
release
-
Statement type:
File details
Details for the file eyconf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eyconf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.2 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 |
3658c16a4a155ec29b6bb67414ff6d58c3fb81778438e1b6417b5f17bf05bbb6
|
|
| MD5 |
42e03a1cf4a168694337f6322dce0f61
|
|
| BLAKE2b-256 |
6d3bc6f80db4405fdd0f3d41dd82fa7f5b76e8e79643bed0584cff9526148e10
|
Provenance
The following attestation bundles were made for eyconf-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on semohr/eyconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eyconf-0.1.0-py3-none-any.whl -
Subject digest:
3658c16a4a155ec29b6bb67414ff6d58c3fb81778438e1b6417b5f17bf05bbb6 - Sigstore transparency entry: 362716612
- Sigstore integration time:
-
Permalink:
semohr/eyconf@f02642adb16da506db5d18efa72788f3cd770179 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/semohr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f02642adb16da506db5d18efa72788f3cd770179 -
Trigger Event:
release
-
Statement type: