Metadata-Version: 2.4
Name: essex-config
Version: 0.0.6
Summary: Python library for creating configuration objects that read from various sources, including files, environment variables, and Azure Key Vault.
Author-email: Andres Morales <andresmor@microsoft.com>
License:     MIT License
        
            Copyright (c) Microsoft Corporation. All rights reserved.
        
            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
Requires-Python: >=3.10
Requires-Dist: azure-identity>=1.16.0
Requires-Dist: azure-keyvault-secrets>=4.8.0
Requires-Dist: pyaml>=6.0.1
Requires-Dist: pydantic>=2.7.3
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: rich>=13.7.1
Requires-Dist: toml>=0.10.2
Requires-Dist: typing-extensions>=4.12.2
Requires-Dist: typing-inspect>=0.9.0
Description-Content-Type: text/markdown

# Getting Started

essex-config is a Python library for creating configuration objects that read from various sources, including files, environment variables, and Azure Key Vault.

```sh
pip install essex-config
```

## Basic Usage

Create a configuration object for connecting to a customer database:

```python
from pydantic import BaseModel, Field
from essex_config import load_config

class CustomerDatabase(BaseModel):
    """Configuration for connecting to the Customer Database"""
    host: str = Field(default="127.0.0.1", description="DB connection host")
    port: int = Field(description="DB connection port")
    password: str = Field(description="DB connection password")

if __name__ == "__main__":
    config = load_config(CustomerDatabase)
    print(config)
```

When `load_config(CustomerDatabase)` is executed, values are populated from environment variables or default values.

## Nested Configurations

Nest configuration objects:

```python
class Inner(BaseModel):
    inner_hello: str

class NestedConfiguration(BaseModel):
    hello: str
    nested: Inner

nested_config = load_config(NestedConfiguration)
```

`load_config()` populates every field, including `nested_config.nested.inner_hello`. The default prefix for every field in `Inner` is `nested`, which can be changed with `Annotated[Inner, Prefixed("new_prefix")]`.
