Skip to main content

Proteus

Unified Configuration Management Library for Python

CI codecov Python Versions License

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 pyyaml and python-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().

Loading OS Environment Variables

For containerized or production environments (like Docker or Kubernetes) where configurations are passed as system environment variables, you can load them directly using load_environ:

from proteus import Proteus

config = Proteus()

# Load OS environment variables starting with specified prefixes
config.load_environ(prefixes=["DATABASE_", "APP_"])

# Environment variables like DATABASE__HOST=localhost are automatically nested
print(config.get("DATABASE.HOST"))  # Prints 'localhost'

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


Metadata

Release files for proteus-config 1.2.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 proteus-config 1.2.0
File Size Uploaded Provenance Actions
proteus_config-1.2.0.tar.gz 21.5 kB With provenance Details for proteus_config-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for proteus-config 1.2.0
File Interpreter ABI Platform Actions
proteus_config-1.2.0-py3-none-any.whl Python 3 none any Details for proteus_config-1.2.0-py3-none-any.whl

Total release size: 55.3 kB

Release files / proteus_config-1.2.0.tar.gz

Download URL proteus_config-1.2.0.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9829d52e251860b0368c2fbd4792517c033a3654a05eee4edb258b11030dadb2
BLAKE2b-256 checksum
How to use checksums
e6758c799d95bc7960efb27765c095f31ea3d4909d5cc59f2cb84b8cbb364953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.

Transparency log

Release files / proteus_config-1.2.0-py3-none-any.whl

Download URL proteus_config-1.2.0-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98b4300a14d9d82e4f90f1ec8f0bff60c1ad09ebd98614baa6c035b98ccc3906
BLAKE2b-256 checksum
How to use checksums
bc07210247d51b82546f3d666749f9cbe9b65f379576c3b55b19699bb860bfa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.

Transparency log

Security for proteus-config 1.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for proteus_config-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.

Transparency log

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