Configuration parameter handling library
Project description
uncouple
uncouple provides a Pydantic-based interface on top of python-decouple for managing configurations, incuding out of the box support for parsing network addresses, YAML data and more.
Installation
Install uncouple using uv:
uv add uncouple
Or using pip:
pip install uncouple
Synopsis
from uncouple import Config, StringList, Addr, YarlUrl
from pathlib import Path
class OptionsConfig(Config):
TIMEOUT: int
WHITELIST: StringList
LOG_PATH: Path
class AppConfig(Config):
NAME: str = 'my-default-name'
REMOTE_ADDR: Addr
API_URL: YarlUrl
OPTIONS: OptionsConfig
# With environment as:
#
# APP_REMOTE_ADDR=localhost:1234
# APP_API_URL=http://api.example.com:1234/foo
# APP_OPTIONS_TIMEOUT=60
# APP_OPTIONS_WHITELIST=john,paul,george,ringo
# APP_OPTIONS_LOG_PATH=/var/logs/app
#
config = AppConfig.load(prefix='APP')
# Accessing configuration values
config.NAME # 'my-default-name', from default
config.REMOTE_ADDR # Addr(host='localhost', port=1234)
config.API_URL # yarl.URL('http://api.example.com:1234/foo')
config.OPTIONS.TIMEOUT # 60
config.OPTIONS.WHITELIST # ['john', 'paul', 'george', 'ringo']
config.OPTIONS.LOG_PATH # Path('/var/logs/app')
Contributing
Contributions to uncouple are welcome! Please follow the standard GitHub pull request workflow. Make sure to add unit tests for any new or changed functionality and ensure your code passes existing tests.
For bug reports, feature requests, or general inquiries, please open an issue.
This template provides a foundation for the README. Depending on the package's complexity and additional functionalities not covered in the snippet, you might need to expand on certain sections or add new ones, such as "Advanced Usage", "API Reference", or "Troubleshooting".
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 uncouple-1.0.0.tar.gz.
File metadata
- Download URL: uncouple-1.0.0.tar.gz
- Upload date:
- Size: 92.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daa2b699c4515e49e17c6ddfb5d107f1ceabe107ae23d6c822f0f53048c21895
|
|
| MD5 |
fede209147985f1f4917833cef5bfbab
|
|
| BLAKE2b-256 |
2752728c94b30d07967d618320c93d7f70049128fbdd6181901d37e83d5cf07a
|
Provenance
The following attestation bundles were made for uncouple-1.0.0.tar.gz:
Publisher:
release.yaml on Unholster/python-uncouple
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uncouple-1.0.0.tar.gz -
Subject digest:
daa2b699c4515e49e17c6ddfb5d107f1ceabe107ae23d6c822f0f53048c21895 - Sigstore transparency entry: 601218330
- Sigstore integration time:
-
Permalink:
Unholster/python-uncouple@319b86e0bfc6ded4c302dfe183c1e92327508707 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Unholster
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@319b86e0bfc6ded4c302dfe183c1e92327508707 -
Trigger Event:
push
-
Statement type:
File details
Details for the file uncouple-1.0.0-py3-none-any.whl.
File metadata
- Download URL: uncouple-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 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 |
5e24c76f2e4d93fbbe9ce4f01395ce9c0aa5f09f16cdb9b3a003df1ba5cef7e1
|
|
| MD5 |
b5dfd314f102e96d47aa4a7ceea9143d
|
|
| BLAKE2b-256 |
f184433fe368dcd95b297f9c511dde86d2c93b08c4afdda1331e54e2319cce28
|
Provenance
The following attestation bundles were made for uncouple-1.0.0-py3-none-any.whl:
Publisher:
release.yaml on Unholster/python-uncouple
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uncouple-1.0.0-py3-none-any.whl -
Subject digest:
5e24c76f2e4d93fbbe9ce4f01395ce9c0aa5f09f16cdb9b3a003df1ba5cef7e1 - Sigstore transparency entry: 601218331
- Sigstore integration time:
-
Permalink:
Unholster/python-uncouple@319b86e0bfc6ded4c302dfe183c1e92327508707 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Unholster
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@319b86e0bfc6ded4c302dfe183c1e92327508707 -
Trigger Event:
push
-
Statement type: