Metadata-Version: 2.4
Name: proteus-config
Version: 1.1.0
Summary: Unified configuration management library for Python
Project-URL: Homepage, https://github.com/lucadileo9/proteus
Project-URL: Documentation, https://github.com/lucadileo9/proteus#readme
Project-URL: Repository, https://github.com/lucadileo9/proteus
Project-URL: Issues, https://github.com/lucadileo9/proteus/issues
Author-email: Luca Di Leo <lucadileo70@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Luca Di Leo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: config,configuration,design-patterns,json,settings,yaml
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: tomli-w>=1.0.0
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: bandit>=1.7.0; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Description-Content-Type: text/markdown

# Proteus

**Unified Configuration Management Library for Python**

[![CI](https://github.com/lucadileo9/proteus/actions/workflows/ci.yml/badge.svg)](https://github.com/lucadileo9/proteus/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/lucadileo9/proteus/branch/main/graph/badge.svg)](https://codecov.io/gh/lucadileo9/proteus)
![Python Versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
![License](https://img.shields.io/github/license/lucadileo9/proteus)

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:

```bash
# 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](https://github.com/lucadileo9/proteus/blob/main/docs/cli.md) for more details.

---

## Quick Start

### Installation

Install Proteus directly from PyPI:

```bash
pip install proteus-config
```

### Basic Usage

```python
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/](https://github.com/lucadileo9/proteus/tree/main/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:
- [Architecture](https://github.com/lucadileo9/proteus/blob/main/docs/architecture.md)
- [ConfigurationManager](https://github.com/lucadileo9/proteus/blob/main/docs/manager.md)
- [Format Creators](https://github.com/lucadileo9/proteus/blob/main/docs/formats.md)
- [Readers](https://github.com/lucadileo9/proteus/blob/main/docs/readers.md)
- [Writers](https://github.com/lucadileo9/proteus/blob/main/docs/writers.md)
- [Test Suite](https://github.com/lucadileo9/proteus/blob/main/docs/tests.md)

---

## Development and Contributing

If you wish to contribute to the project or understand the development workflow, please refer to our **[Developer Guide](https://github.com/lucadileo9/proteus/blob/main/docs/developer_guide.md)**.

### 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](https://github.com/lucadileo9/proteus/blob/main/LICENSE) file for details.

---

## Contact

**Luca Di Leo**
- GitHub: [@lucadileo9](https://github.com/lucadileo9)
- Repository: [proteus](https://github.com/lucadileo9/proteus)

---
