Metadata-Version: 2.4
Name: ucl-parser
Version: 1.0.0
Summary: Universal Configuration Language (UCL) Parser
Author-email: Ras_rap <raspberryscrap@gmail.com>
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/ras-rap/UCL
Project-URL: Repository, https://github.com/ras-rap/UCL
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.8; extra == "dev"
Dynamic: license-file

# UCL Parser

A Python library for parsing Universal Configuration Language (UCL) files.

## Features

- Complete implementation of the UCL specification
- Support for all UCL data types (strings, numbers, booleans, arrays, objects, null)
- Arithmetic operations and string concatenation
- Variable references and complex path resolution
- Environment variable resolution
- Type conversion system
- Include/import functionality
- Defaults section support
- Comprehensive error handling

## Installation

```bash
pip install ucl-parser
```

## Quick Start

```python
from ucl_parser import parse_ucl_file, parse_ucl_string

# Parse from file
config = parse_ucl_file("config.ucl")

# Parse from string
config_string = """
[Database]
host = "localhost"
port = 5432
enabled = true
"""

config = parse_ucl_string(config_string)
print(config['Database']['host'])  # Output: localhost
```

## UCL Syntax Overview

UCL supports various data types and features:

### Basic Key-Value Pairs
```ucl
[Section]
key = "value"
number = 42
flag = true
```

### Arrays and Objects
```ucl
[Data]
list = [1, 2, 3, "four"]
config = {
    "nested": {
        "key": "value"
    }
}
```

### Variable References
```ucl
[Config]
base_url = "https://api.example.com"
full_url = base_url + "/v1/users"
```

### Environment Variables
```ucl
[Runtime]
api_key = $ENV{API_KEY}
debug = $ENV{DEBUG_MODE}
```

### Type Conversions
```ucl
[Conversions]
string_num = "123"
as_int = string_num.int
as_float = string_num.float
as_bool = "true".bool
```

## Testing

Run the test suite:

```bash
python -m pytest test_ucl_parser.py -v
```

## License

MIT License
