Metadata-Version: 2.4
Name: amanoki
Version: 0.1.0
Summary: Python client for the Amanoki electricity-market regime API
Project-URL: Homepage, https://amanoki.com
Project-URL: Reference, https://api.amanoki.com/v1/reference
Project-URL: Status, https://api.amanoki.com/v1/status
Author: Amanoki
License: MIT
Keywords: electricity,forecast,jepx,power,regime
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# amanoki

Python client for the [Amanoki](https://amanoki.com) electricity-market
regime API. Covers JEPX today; ERCOT / PJM / CAISO / AEMO / NYISO are
catalogued and will land as adapters arrive.

```bash
pip install amanoki
```

## Quick start

```python
from amanoki import Client

c = Client()                     # public endpoints, no auth
r = c.get_regime("jepx", "tokyo")
print(r.regime, r.price, r.price_unit)   # normal 16.75 kWh

s = c.spike_probability("jepx", "tokyo")
for cell in s.cells:
    print(cell.threshold, cell.horizon_min, cell.p, cell.base_rate)
```

All methods also exist on `AsyncClient`:

```python
import asyncio
from amanoki import AsyncClient

async def main():
    async with AsyncClient() as c:
        status = await c.status()
        print(status.markets_with_data, status.latest_bar_ms)

asyncio.run(main())
```

## Endpoints covered

| Method                      | Backs                                                     |
| --------------------------- | --------------------------------------------------------- |
| `list_markets()`            | `GET /v1/markets`                                         |
| `get_areas(market)`         | `GET /v1/markets/{market}/areas`                          |
| `get_regime(m, a)`          | `GET /v1/power/{m}/{a}`                                   |
| `spike_probability(m, a)`   | `GET /v1/power/{m}/{a}/spike-probability`                 |
| `transitions(m, a, limit=)` | `GET /v1/power/{m}/{a}/transitions?limit=`                |
| `status()`                  | `GET /v1/status`                                          |
| `health()`                  | `GET /v1/health`                                          |

## Error handling

All non-2xx responses raise a typed subclass of `AmanokiError`:

```python
from amanoki import Client, NotFoundError, RateLimitError

try:
    c.get_regime("jepx", "okinawa")
except NotFoundError:
    ...
except RateLimitError as e:
    time.sleep(e.retry_after or 30)
```

## Authentication

`Client(api_key=...)` sets `Authorization: Bearer <key>`. Public
endpoints don't require a key. Paid-tier endpoints are planned — the
hook is in place so code written today keeps working when they open.

## Versioning

Matches the API surface, not the service version. Breaking client
changes bump the major.
