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.
Impact, lead-lag, conditional returns
# Return distribution at 1h / 4h / 24h after past HIGH transitions.
imp = c.impact("btcusdt", to="high", timeframe="1m", lookback_days=180)
print(imp["sample_size"], imp["horizons"]["1h"]["p75"])
if imp.get("warning"):
print("small-N:", imp["warning"])
ll = c.lead_lag("btcusdt", "ethusdt", to="high", lookback_days=90)
print(ll["hit_rate"], ll.get("lag"))
cr = c.conditional_returns("btcusdt", timeframe="15m")
print(cr["by_regime"]["high"]["median"], cr["baseline"]["median"])
Top-down alignment and narrative
td = c.top_down("btcusdt", match="any", from_tf="1d", to_tf="15m")
print(td["consensus"], td["alignment_score"], td["aligned_tfs"])
st = c.stories("btcusdt", timeframe="15m", days=7)
for line in st["stories"]:
print(line)
Public stats (no key required)
s = c.public_stats()
print(s["uptime_observed_pct"], s["uptime_window_days"])
i = c.public_incidents()
print(i["count"], "incidents in the last 30 days")
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.
Metadata
Release files for amaneki 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amaneki-0.6.0.tar.gz | 27.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amaneki-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.4 kB
Release files / amaneki-0.6.0.tar.gz
| Download URL | amaneki-0.6.0.tar.gz |
|---|---|
| Size | 27.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da9c34a14f2a6b51496a14a42a9dba04e383ba62ac13bc1d048b8dfe9a71fbfa
|
|
BLAKE2b-256 checksum How to use checksums |
610513d6c3baf156a5e6ae91a3f3c758db99c18800fda86214610ddd36713b8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / amaneki-0.6.0-py3-none-any.whl
| Download URL | amaneki-0.6.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d0e643094ab86460f33207de8b20b7917ba4fe10df12d2bfe3d382f0c100436
|
|
BLAKE2b-256 checksum How to use checksums |
fc70aabd9501ef9c38dd04f3379e07a860bc84f938956f1451bb921d17d7504c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|