Metadata-Version: 2.4
Name: lat-lng-sdk
Version: 0.3.0
Summary: Official Python SDK for the Lat·Lng geospatial conversion API (lat-lng.com).
Author-email: JADAKA UG <hello@lat-lng.com>
License: MIT
Project-URL: Homepage, https://lat-lng.com/docs/api
Project-URL: Source, https://github.com/mjannis1/lat-lng
Keywords: geospatial,gis,geojson,kml,shapefile,gpx,topojson,wkt,csv,conversion,reprojection
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: responses>=0.24; extra == "dev"

# lat-lng (Python SDK)

Official Python SDK for the [Lat·Lng](https://lat-lng.com) geospatial conversion API.

## Install

```bash
pip install lat-lng-sdk
```

## Usage

```python
from lat_lng import LatLngClient

client = LatLngClient("latlng_live_...")  # your API key

result = client.convert(open("input.kml", "rb"), to="geojson")
with open("output.geojson", "wb") as f:
    f.write(result.download())
```

Supported formats: geojson, kml, csv, wkt, gpx, topojson, wkb, shapefile, gml, flatgeobuf, geoparquet.

Typed exceptions: `AuthError`, `ValidationError`, `RateLimitError` (auto-retried on 429), `QuotaExceededError`, `ConversionFailedError`.


## Async (large files via URL)

```python
from lat_lng import LatLngClient
client = LatLngClient("latlng_live_...")

job = client.convert_async(input_url="https://example.com/big.shp.zip", output_format="geojson")
done = client.wait_for_job(job.job_id)
data = done.download()
```

> Async takes a **public URL**, not a local upload.

## Webhook verification

```python
from lat_lng import verify_webhook_signature

ok = verify_webhook_signature(raw_body, request.headers["X-Webhook-Signature"], webhook_secret)
```

Pass the same `webhook_secret` to `convert_async(..., webhook_url=..., webhook_secret=...)` to have callbacks signed.
