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.2.0.tar.gz (24.3 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.2.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amaneki-0.2.0.tar.gz
  • Upload date:
  • Size: 24.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 5e938efe3c950472f8cf471274f3d72da1ae7852c95dacd6db24353055776f5d
MD5 a5b0ae10ca2fb5090f685c3a98b9413c
BLAKE2b-256 f69eef5a1628fff4c6470ba2c638def12ac1b2f428e1facaaa53b7ae6a3dc420

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amaneki-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42d40ee2faa823051b9dd808e271d6d3bfb537b1eab01fec8d2dd97eccf0e362
MD5 b19ffd2a9d5204314d41294f2ca579b9
BLAKE2b-256 af7434124201fdd42b6fc268eedc38e77d12c32659b44e8f346d7d56f1ced521

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