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.3.0.tar.gz (24.9 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.3.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amaneki-0.3.0.tar.gz
  • Upload date:
  • Size: 24.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 3bbeedc9aaa48e5c1a028b9665e47683e254e2cb3967989966dd4e1e209992f1
MD5 8a6c0bdcf0a615423ac0b6969c7932f4
BLAKE2b-256 badf8bbb87b5aa4d1f85202487398fac3ffb59e21990062a68a2a4d77c16bc5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amaneki-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76aa3e0bac6ced86fc1b0962a766bd804ed08b03e25cb2279f83f2dc089f4d5e
MD5 582bc09d42c795f7af598bfdb1d423aa
BLAKE2b-256 e7ac7cdc0e684c44762cfb10befc76ae0035214d4f0b10b71d6992281aea6da4

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