Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uncouple-1.0.0.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uncouple-1.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for uncouple-1.0.0.tar.gz
Algorithm Hash digest
SHA256 daa2b699c4515e49e17c6ddfb5d107f1ceabe107ae23d6c822f0f53048c21895
MD5 fede209147985f1f4917833cef5bfbab
BLAKE2b-256 2752728c94b30d07967d618320c93d7f70049128fbdd6181901d37e83d5cf07a

See more details on using hashes here.

Provenance

The following attestation bundles were made for uncouple-1.0.0.tar.gz:

Publisher: release.yaml on Unholster/python-uncouple

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for uncouple-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e24c76f2e4d93fbbe9ce4f01395ce9c0aa5f09f16cdb9b3a003df1ba5cef7e1
MD5 b5dfd314f102e96d47aa4a7ceea9143d
BLAKE2b-256 f184433fe368dcd95b297f9c511dde86d2c93b08c4afdda1331e54e2319cce28

See more details on using hashes here.

Provenance

The following attestation bundles were made for uncouple-1.0.0-py3-none-any.whl:

Publisher: release.yaml on Unholster/python-uncouple

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page