Metadata-Version: 2.4
Name: taxlocus
Version: 0.1.0
Summary: Thin Python client for the TaxLocus REST API
License: MIT
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# taxlocus (Python)

Thin Python client for the [TaxLocus](https://taxlocus.com) REST API.

## Install

```bash
pip install taxlocus
```

## Usage

```python
from taxlocus import TaxLocus

client = TaxLocus(api_key="tlx_live_...")
rate = client.lookup_rate("general", lat=37.7749, lng=-122.4194)
print(rate["combined_rate"])
```

## Methods

All methods POST to the API and return the parsed JSON response as a `dict`.
A non-2xx response raises `TaxLocusError` (with `.code`, `.message`,
`.status_code`).

- `lookup_rate(product_category, *, lat, lng, address, sale_amount, as_of)` — `/v1/rate/lookup`
- `calculate_cart(line_items, *, lat, lng, address, as_of)` — `/v1/cart/calculate`
- `check_nexus(state, ytd_sales, ytd_transactions, *, include_marketplace_sales)` — `/v1/nexus/check`
- `filing_calendar(state, *, annual_revenue, registration_date)` — `/v1/filing/calendar`
- `taxability_check(state, *, product_category, product_categories)` — `/v1/taxability/check`

Pass either `lat` + `lng` or an `address` dict
(`line1`, `city`, `state`, `postal_code`) to the location-based methods.

The client is also a context manager:

```python
with TaxLocus(api_key="tlx_live_...") as client:
    result = client.check_nexus("CA", ytd_sales=600_000, ytd_transactions=320)
```
