Skip to main content

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

amaneki-0.5.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amaneki-0.5.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file amaneki-0.5.0.tar.gz.

File metadata

  • Download URL: amaneki-0.5.0.tar.gz
  • Upload date:
  • Size: 25.6 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

Hashes for amaneki-0.5.0.tar.gz
Algorithm Hash digest
SHA256 e1ce8928425e39209b2bbf76d8c8adadb8112f07ea67c5677e8b91163eb485f1
MD5 4e68daea090d25e68cf7285fc826dc4c
BLAKE2b-256 325cd568791c14ed114d7bfa091af2ae559674b694dadfc8688d59f4c106c990

See more details on using hashes here.

File details

Details for the file amaneki-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: amaneki-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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

Hashes for amaneki-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3ace6e9d60351b432e0ea55683ed14a86a9de70f5f77d1156cd03b66fb2d2d7
MD5 22e2fdcad3c6f5a444832b37e4739173
BLAKE2b-256 bb6ca82dc94f33e394d224e234b28669a7f097c49a7008bee15b4f62e72d5a43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page