Metadata-Version: 2.4
Name: pydefinition
Version: 0.1.1
Summary: Environment-driven configuration helpers with low boilerplate
Author-email: PyDefinition Contributors <example@example.com>
License: MIT
Project-URL: Homepage, https://github.com/Rushberg/PyDefinition
Project-URL: Documentation, https://github.com/Rushberg/PyDefinition#readme
Project-URL: Issues, https://github.com/Rushberg/PyDefinition/issues
Project-URL: Changelog, https://github.com/Rushberg/PyDefinition/blob/main/CHANGELOG.md
Keywords: environment,configuration,env,variables,settings
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
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: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.8"

# PyDefinition

Environment-driven configuration helpers with low boilerplate.

## Installation

```bash
pip install pydefinition
```

## Features

- Environment variable management with descriptors
- Type casting for environment variables
- Default values and required variables
- Automatic naming based on class structure
- Caching for performance

## Usage

```python
from pydefinition import EnvVar, parse_bool, parse_int, Required

class AppConfig:
    # Basic usage with default value
    PORT = EnvVar(default=8080, cast=parse_int)
    
    # Required environment variable (raises KeyError if not set)
    API_KEY = EnvVar(default=Required)
    
    # Boolean parsing
    DEBUG = EnvVar(default=False, cast=parse_bool)
    
    # Custom name for environment variable
    DATABASE_URL = EnvVar(default="sqlite:///app.db", name="DB_URL")

# Usage
config = AppConfig()
port = config.PORT  # Will read from APP_CONFIG_PORT or use default 8080
api_key = config.API_KEY  # Will read from APP_CONFIG_API_KEY or raise KeyError
```

## Advanced Usage

See the [examples directory](https://github.com/Rushberg/PyDefinition/tree/main/pydefinition/examples) for more advanced usage patterns.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
