Metadata-Version: 2.4
Name: aioevtracker
Version: 0.1.0
Summary: Async Python client for EV Tracker API
Project-URL: Homepage, https://github.com/evtracker/aioevtracker
Project-URL: Documentation, https://github.com/evtracker/aioevtracker#readme
Project-URL: Repository, https://github.com/evtracker/aioevtracker
Project-URL: Issues, https://github.com/evtracker/aioevtracker/issues
Author: EV Tracker Team
License-Expression: MIT
License-File: LICENSE
Keywords: aiohttp,async,charging,electric-vehicle,ev,evtracker
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.8.0
Provides-Extra: dev
Requires-Dist: aioresponses>=0.7; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# aioevtracker

Async Python client for [EV Tracker](https://evtracker.cz) API.

## Installation

```bash
pip install aioevtracker
```

## Usage

```python
import asyncio
from aioevtracker import EVTrackerClient

async def main():
    async with EVTrackerClient(api_key="your-api-key") as client:
        # Get all cars
        cars = await client.get_cars()
        for car in cars:
            print(f"{car.name} (ID: {car.id})")

        # Get charging statistics
        state = await client.get_state()
        print(f"Monthly energy: {state.monthly_energy} kWh")
        print(f"Monthly cost: {state.monthly_cost} CZK")

        # Log a charging session
        session = await client.log_session_simple(
            energy_kwh=45.5,
            energy_source="GRID",
            rate_type="LOW",
        )
        print(f"Logged session ID: {session.id}")

asyncio.run(main())
```

## With existing aiohttp session

```python
import aiohttp
from aioevtracker import EVTrackerClient

async with aiohttp.ClientSession() as session:
    client = EVTrackerClient(
        api_key="your-api-key",
        session=session,
    )
    cars = await client.get_cars()
```

## API Reference

### EVTrackerClient

- `get_cars()` - Get list of user's cars
- `get_default_car()` - Get default car
- `get_state()` - Get Home Assistant state with statistics
- `log_session(...)` - Log a charging session with full control
- `log_session_simple(...)` - Log a charging session with smart defaults
- `validate_api_key()` - Validate the API key

### Models

- `Car` - Electric vehicle
- `ChargingSession` - Charging session
- `HomeAssistantState` - Statistics state

### Exceptions

- `EVTrackerApiError` - Base exception
- `EVTrackerAuthenticationError` - Invalid API key (401/403)
- `EVTrackerConnectionError` - Connection failed
- `EVTrackerRateLimitError` - Rate limit exceeded (429)

## License

MIT
