Unified configuration management library for Python
Project description
Proteus
Unified Configuration Management Library for Python
Proteus is a Python library that provides a clean, pattern-based approach to managing application configurations. It allows you to load settings from multiple formats (JSON, YAML, TOML, ENV) and access them through a unified interface, regardless of the source format.
Features
- Multi-format Support: Load configurations from JSON, YAML, and TOML files seamlessly.
- Unified Interface: Access all settings through a single, consistent API with dot-notation.
- Namespacing Support: Inject configurations into specific nested paths to avoid collisions.
- Smart Merging: Combine multiple configuration files with intelligent deep-merge.
- Translation Engine: Convert configuration files between formats programmatically.
- Thread-Safe: Optional singleton access via
ConfigurationManager.instance(). - Context Manager: Use
with ConfigurationManager.temporary()for isolated workspaces. - Easily Extensible: Add support for new formats with minimal code.
- Zero Heavy Dependencies: Only requires
pyyamlandpython-dotenv.
🛠️ CLI
Proteus comes with a built-in Command Line Interface for quick configuration tasks:
# Convert between formats
proteus translate settings.env settings.json
# Read a specific key
proteus get config.yaml database.host
# Merge multiple files into one
proteus merge base.json prod.env --out final.toml
See CLI Documentation for more details.
Quick Start
Installation
Install Proteus directly from PyPI:
pip install proteus-config
Basic Usage
from proteus import Proteus
# or from proteus import ConfigurationManager
config = Proteus()
config.load("examples/configs/app.yaml")
print(config.get("app_name"))
print(config.get("database.host"))
print(config.get("server.port"))
For a shared application-wide instance, use Proteus.instance().
For detailed and comprehensive examples covering all formats, see the examples/ directory.
Architecture and Design Patterns
Proteus is built on a foundation of proven design patterns from the Gang of Four catalog:
- Optional Singleton Pattern: Global point of access to configuration.
- Context Manager: Isolated temporary workspaces.
- Facade Pattern: Simplified API over complex orchestration.
- Factory Method Pattern: Transparent format detection and creator selection.
- Template Method Pattern: Rigid algorithms for I/O with format-specific hooks.
- Adapter Pattern: Decoupling from third-party parsing libraries.
For detailed architecture documentation and diagrams, see:
Development and Contributing
If you wish to contribute to the project or understand the development workflow, please refer to our Developer Guide.
Project Structure
proteus/
├── src/proteus/ # Source code
│ ├── core.py # ConfigurationManager
│ ├── exceptions.py # Custom exceptions
│ ├── adapters/ # Format adapters
│ ├── formats/ # Creator classes for readers/writers
│ ├── readers/ # Template Method readers
│ └── writers/ # Template Method writers
├── examples/ # Usage examples and configs
└── docs/ # Documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
Luca Di Leo
- GitHub: @lucadileo9
- Repository: proteus
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
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 proteus_config-1.1.0.tar.gz.
File metadata
- Download URL: proteus_config-1.1.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb1aa0c0a03f0acc0dfb480db81587a0d2dd7a27b990eaa5aada1dc63bd95d75
|
|
| MD5 |
242b0c9d1158427e0a34d6686d01131b
|
|
| BLAKE2b-256 |
dc7d579a466d483e08336ff3d1edf6c55b0a6663660788758f398925123b11b5
|
Provenance
The following attestation bundles were made for proteus_config-1.1.0.tar.gz:
Publisher:
publish.yml on lucadileo9/proteus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteus_config-1.1.0.tar.gz -
Subject digest:
cb1aa0c0a03f0acc0dfb480db81587a0d2dd7a27b990eaa5aada1dc63bd95d75 - Sigstore transparency entry: 1827940034
- Sigstore integration time:
-
Permalink:
lucadileo9/proteus@aeb7d24c7b426c5132c986d5a52c7d0065b4d993 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/lucadileo9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aeb7d24c7b426c5132c986d5a52c7d0065b4d993 -
Trigger Event:
release
-
Statement type:
File details
Details for the file proteus_config-1.1.0-py3-none-any.whl.
File metadata
- Download URL: proteus_config-1.1.0-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75d01e2e266ce596d74af1aa74ef4865042a78c81afa68fa33eb216156b8d24
|
|
| MD5 |
0b4dbe1f258c88c774016d19ab91e7dc
|
|
| BLAKE2b-256 |
e994869b8df9a83a2e84d737da5a29928fca2cc9ba9d8403a9def8be3a6d6e42
|
Provenance
The following attestation bundles were made for proteus_config-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on lucadileo9/proteus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteus_config-1.1.0-py3-none-any.whl -
Subject digest:
d75d01e2e266ce596d74af1aa74ef4865042a78c81afa68fa33eb216156b8d24 - Sigstore transparency entry: 1827940123
- Sigstore integration time:
-
Permalink:
lucadileo9/proteus@aeb7d24c7b426c5132c986d5a52c7d0065b4d993 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/lucadileo9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aeb7d24c7b426c5132c986d5a52c7d0065b4d993 -
Trigger Event:
release
-
Statement type: