Python client for the Amaneki volatility-regime API
Project description
amaneki
Python client for the Amaneki volatility-regime API.
pip install amaneki
Usage
from amaneki import Client
c = Client(api_key="ak_...")
snap = c.get_regime("btcusdt")
print(snap.regime, snap.z_vol) # e.g. "normal" -0.83
for t in c.get_history("btcusdt", from_ms=1776000000000):
print(t.ts_ms, t.from_regime, "→", t.to_regime)
Cross-exchange consensus
cs = c.get_consensus("btcusdt", timeframe="15m")
print(cs.consensus, f"{cs.agreed}/{cs.available}")
for name, v in cs.venues.items():
print(name, v.regime, v.z_vol)
Backtest
r = c.run_backtest("btcusdt", timeframe="15m", rule="long_low_exit_normal")
print(r.n_trades, r.total_return, r.max_drawdown)
Rules: long_low_exit_normal, short_high_exit_normal, avoid_high.
Optional thresholds={"high_enter": 3.0, ...} overrides the running preset.
Async + streaming
import asyncio
from amaneki import AsyncClient
async def main():
async with AsyncClient(api_key="ak_...") as c:
async for ev in c.stream():
print(ev.type, ev.symbol, ev.to_regime)
asyncio.run(main())
No key
get_regime and get_history are callable without an API key — you
get the free tier, capped at 60 requests/minute per IP.
Errors
from amaneki import AuthError, RateLimitError, NotFoundError
Raised on HTTP 401 / 429 / 404. RateLimitError.retry_after holds the
seconds from the Retry-After header when the server provides one.
Project details
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 amaneki-0.4.0.tar.gz.
File metadata
- Download URL: amaneki-0.4.0.tar.gz
- Upload date:
- Size: 25.5 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 |
6c5e304e8deef4d79d3c40136a8d81c3762a327b288efcc6b3d9f9606f3dddfe
|
|
| MD5 |
7685a885ac25f04834845229e654b54a
|
|
| BLAKE2b-256 |
7a6644476871d7813f68879e945ff59768fbccc013944f0c5e271a219faa7f5c
|
File details
Details for the file amaneki-0.4.0-py3-none-any.whl.
File metadata
- Download URL: amaneki-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.1 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 |
950e51aaf8290ca5599cfda1f4666d8a61146f389f8b23003686cec84ec9cdaf
|
|
| MD5 |
11103bf7b6dd7e8960cd6dd354ec75aa
|
|
| BLAKE2b-256 |
8b09d858213b0fa49068ccb1bbdf87ecbd86cd1b2d4d7affcc91ed7f7cad0bd7
|