Metadata-Version: 2.4
Name: eviav
Version: 0.1.0
Summary: Cliente oficial de Eviav — APIs geoespaciales (geocoding, ruteo, mapas, isócronas, IA) para LATAM. Sync + async sobre httpx.
Project-URL: Homepage, https://eviav.com/docs
Project-URL: Documentation, https://eviav.com/docs
Project-URL: Repository, https://github.com/eviav/sdk-python
Author-email: Eviav <soporte@eviav.com>
License: MIT
License-File: LICENSE
Keywords: eviav,geocoding,geospatial,isochrone,latam,maps,openstreetmap,routing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# eviav — Python client

Cliente oficial de **Eviav** para Python. APIs geoespaciales (geocoding, ruteo, mapas, isócronas, optimización de flota, IA) para LATAM. Sync + async sobre [httpx](https://www.python-httpx.org/).

```bash
pip install eviav
```

## Quickstart (sync)

```python
from eviav import Client

client = Client(api_key="eviav_live_…")

res = client.geocode("Av. Amazonas, Quito")
print(res["results"][0]["lat"], res["results"][0]["lon"])

# Ruteo
route = client.directions([(-78.51, -0.22), (-78.48, -0.12)], steps=True)
print(route["routes"][0]["distance"], "metros")

client.close()
```

O como context manager:

```python
with Client(api_key="…") as client:
    res = client.geocode("Quito")
```

## Quickstart (async)

```python
import asyncio
from eviav import AsyncClient

async def main():
    async with AsyncClient(api_key="eviav_live_…") as client:
        res = await client.geocode("Quito")
        print(res["results"][0]["label"])

asyncio.run(main())
```

## Métodos

Todos disponibles en `Client` (sync) y `AsyncClient` (async, awaitables):

| Método | Endpoint |
|---|---|
| `geocode(q, lat=, lon=, limit=)` | `GET /v1/geocode` |
| `reverse(lat, lon)` | `GET /v1/reverse` |
| `search(text, lat=, lon=, limit=)` | `GET /v1/search` |
| `places(lat, lon, category, radius=)` | `GET /v1/places` |
| `directions(coordinates, steps=, profile=)` | `GET /v1/directions` |
| `matrix(coordinates)` | `GET /v1/matrix` |
| `optimize(coordinates, roundtrip=)` | `POST /v1/optimization` |
| `fleet(body)` | `POST /v1/fleet` |
| `match(coordinates)` | `GET /v1/match` |
| `nearest(point, number=)` | `GET /v1/nearest` |
| `isochrone(lat, lon, contours=, costing=)` | `GET /v1/isochrone` |
| `elevation(lat, lon)` | `GET /v1/elevation` |
| `timezone(lat, lon)` | `GET /v1/timezone` |
| `tilequery(lat, lon, radius=)` | `GET /v1/tilequery` |
| `list_datasets(layer=)` | `GET /v1/datasets` |
| `grounding(query, lat=, lon=)` | `POST /v1/grounding` |

Las coordenadas son tuplas `(lon, lat)` (formato GeoJSON).

## Manejo de errores

```python
from eviav import Client, EviavError

try:
    client.geocode("")
except EviavError as e:
    print(e.status, e.code, e.request_id)
```

## Reintentos

Reintenta automáticamente en `429` y `5xx` con backoff exponencial, honrando el header `Retry-After`. Configurable con `max_retries=`.

## Licencia

MIT © Eviav
