Metadata-Version: 2.4
Name: enea-outages
Version: 0.3.1
Summary: Python library to get information about power outages from Enea Operator.
Project-URL: Homepage, https://github.com/TheUndefined/enea-outages
Project-URL: Bug Tracker, https://github.com/TheUndefined/enea-outages/issues
Author: TheUndefined
License-Expression: MIT
License-File: LICENSE
Keywords: api,enea,outages,power
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: beautifulsoup4>=4.12.2
Requires-Dist: httpx>=0.26.0
Provides-Extra: dev
Requires-Dist: black>=23.11.0; extra == 'dev'
Requires-Dist: mypy>=1.7.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.28.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.6; extra == 'dev'
Requires-Dist: types-beautifulsoup4>=4.12.0; extra == 'dev'
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
Description-Content-Type: text/markdown

# Enea Outages Python Library

A simple Python library to get information about power outages from the Enea Operator website.

## Installation

```bash
pip install enea-outages
```

## Usage (Python)

```python
from enea_outages.client import EneaOutagesClient
from enea_outages.models import OutageType

# Initialize the synchronous client
client = EneaOutagesClient()

# Get a list of available regions
regions = client.get_available_regions()
print(f"Available regions: {regions}")

# Get all planned outages for the "Poznań" region
planned_outages = client.get_outages_for_region("Poznań", outage_type=OutageType.PLANNED)
print(f"Found {len(planned_outages)} planned outages in Poznań.")

# Get all unplanned outages for a specific address in "Szczecin"
unplanned_outages = client.get_outages_for_address(
    address="Wojska Polskiego",
    region="Szczecin",
    outage_type=OutageType.UNPLANNED
)
print(f"Found {len(unplanned_outages)} unplanned outages for the address.")

if unplanned_outages:
    outage = unplanned_outages[0]
    print(
        f"Example -> Area: {outage.region}, "
        f"Description: {outage.description}, "
        f"End Time: {outage.end_time}"
    )
```

## Usage (CLI)

The library also provides a command-line interface (CLI) for quick checks.

```bash
# List all available regions
enea-outages --list-regions

# Get unplanned outages for a specific region
enea-outages --region "Poznań" --type unplanned

# Get planned outages for a specific address in a region
enea-outages --region "Szczecin" --address "Wojska Polskiego" --type planned
```

---

*This project was developed with the assistance of AI tools (Google Gemini). While the code has been reviewed, please use it with standard caution.*