Metadata-Version: 2.5
Name: aioprecioscarburantes
Version: 0.1.0
Summary: Async client for Spanish fuel prices from the Ministry's PreciosCarburantes service
Project-URL: Homepage, https://github.com/jjprz/aioprecioscarburantes
Author: jjprz
License-Expression: MIT
License-File: LICENSE
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: aiohttp>=3.9
Provides-Extra: test
Requires-Dist: mypy; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-aiohttp; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: ruff; extra == 'test'
Description-Content-Type: text/markdown

# aioprecioscarburantes

Async Python client for Spanish fuel prices, from the Spanish Ministry's
official `PreciosCarburantes` REST service (the data behind Geoportal Gasolineras).
No API key needed. Prices are updated every 30 minutes.

```python
import asyncio
from aioprecioscarburantes import FuelType, PreciosCarburantes


async def main() -> None:
    async with PreciosCarburantes() as client:
        result = await client.get_stations_by_municipality("6139")
        for station in result.stations:
            print(station.brand, station.prices.get(FuelType.DIESEL_A))


asyncio.run(main())
```

Methods: `get_provinces()`, `get_municipalities(province_id)`,
`get_stations_by_municipality(municipality_id)`,
`get_stations_by_province(province_id)`, `get_station(municipality_id, station_id)`.
Pass an existing `aiohttp.ClientSession` to share it.
