Skip to main content

PyConFigue

Features

This library provides you an easy way to properly manage your python application configuration easily.

The key features are:

  • Multiple configuration sources support using configuration providers
  • Sources priority managment using a layer based model
  • Typed configuration
  • Autocomplete from IDEs
  • Support of objects configurations using Pydantic

Installation

pip install pyconfigue

Usage

1 - Define your ConFigue Model

from pyconfigue import ConFigueModel
from pydantic import BaseModel


class MyPydanticModel(BaseModel):
    key1: dict[str, str]
    key2: float


class MyConFigueModel(ConFigueModel):
    CONFIG_KEY: str
    CONFIG_KEY_2: int
    CONFIG_KEY_3: list[str]
    CONFIG_KEY_4: MyPydanticModel

2 - Define your Providers

from pyconfigue.providers import StaticFileProvider, EnvProvider, DefaultProvider

# File Provider


file_provider = StaticFileProvider(["my_file.yaml", "my_file_2.yaml"])

# Environment Provider
env_provider = EnvProvider()


# Default Provider
class DefaultConFigue(MyConFigueModel):
    CONFIG_KEY = "test_value"
    CONFIG_KEY_2 = 2
    CONFIG_KEY_3 = ["1", "2"]
    CONFIG_KEY_4 = MyPydanticModel(key1={"k1": "1", "k2": "2"}, key2=1.2)


default_provider = DefaultProvider(DefaultConFigue())

3 - Define your ConFigue Manager

from pyconfigue import ConFigueManager


class MyAppConFigueManager(ConFigueManager, MyConFigueModel):
    pass


CONFIG = MyAppConFigueManager([env_provider, file_provider, default_provider])

4 - Use your ConFigue

from .app_config import CONFIG

print("CONFIG VALUE of CONFIG_KEY", CONFIG.CONFIG_KEY)

5 - Dump the full config

CONFIG.dump()  # dict of every declared key, resolved through the providers
CONFIG.to_model()  # same, as a validated instance of your ConFigueModel

Documentation

See our wiki if you need more details about how the project works.

License

The project is under the MIT License.

Requirements

The project requires:

  • python = ">=3.10"
  • pydantic = "^2.11.4"
  • pyyaml = "^6.0.2"
  • toml = "^0.10.2"

Project Status

NOTE
The project is currently in development phase. If you have any remark or question feel free to open an Issue

Metadata

Release files for pyconfigue 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyconfigue 1.0.0
File Size Uploaded Provenance Actions
pyconfigue-1.0.0.tar.gz 7.5 kB Without provenance Details for pyconfigue-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyconfigue 1.0.0
File Interpreter ABI Platform Actions
pyconfigue-1.0.0-py3-none-any.whl Python 3 none any Details for pyconfigue-1.0.0-py3-none-any.whl

Total release size: 18.7 kB

Release files / pyconfigue-1.0.0.tar.gz

Download URL pyconfigue-1.0.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
507d07aaaa4f6f176feac7d30753f6fe1e49457d24e5fc91df4b085dc0f17bf7
BLAKE2b-256 checksum
How to use checksums
1a2d687a97e6e99d48e0380ebc05f83f270cbf44f80da579ac1fc26ce9ee0d0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.14.7 Linux/6.1.0-37-amd64

Release files / pyconfigue-1.0.0-py3-none-any.whl

Download URL pyconfigue-1.0.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06b7172466fde206f05850d91884c2b1e3a28d43299ce502584363f87ea12ccf
BLAKE2b-256 checksum
How to use checksums
47990a9a195e77384e27439a54603d42821491f6c24882499e6b48327663e8bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.2 CPython/3.14.7 Linux/6.1.0-37-amd64

Security for pyconfigue 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page