Python client for the Amanoki electricity-market regime API
Project description
amanoki
Python client for the Amanoki electricity-market regime API. Covers JEPX today; ERCOT / PJM / CAISO / AEMO / NYISO are catalogued and will land as adapters arrive.
pip install amanoki
Quick start
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:
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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amanoki-0.1.0.tar.gz.
File metadata
- Download URL: amanoki-0.1.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ea8a13566889002615be2ad70b8bc35b3c1132309669616e8b3dde7998764b6
|
|
| MD5 |
d140f20143a1335fb579a2d89a1d571e
|
|
| BLAKE2b-256 |
8ae9e6df15ff09978fc27132f24853fcb0d3676be43b234318023f24d74009d4
|
File details
Details for the file amanoki-0.1.0-py3-none-any.whl.
File metadata
- Download URL: amanoki-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e99ac73b89b65f6599ba545f7b6ef4ef52ff17f4f92bbf30945353af15801c67
|
|
| MD5 |
ff35fc01fe1903640cd52283f375f964
|
|
| BLAKE2b-256 |
6ad6a418e095fab4e8275d7ac8e257bfb2128016a2276eff5ed87f5bd1b86c69
|