Skip to main content

Python SDK for the AttaGo crypto trading dashboard API

Project description

attago — Python SDK

CI PyPI Python SDK for the AttaGo crypto trading dashboard API.

Install

pip install attago

Quick Start

API Key Authentication

import asyncio
from attago import AttaGoClient

async def main():
    async with AttaGoClient(api_key="ak_live_abc123") as client:
        score = await client.agent.get_score("BTC")
        print(f"{score.token}: {score.composite.signal} ({score.composite.score:.1f})")

asyncio.run(main())

Sync Mode

from attago import AttaGoClient

client = AttaGoClient(api_key="ak_live_abc123", sync=True)
score = client.agent.get_score_sync("BTC")
print(score.composite.signal)
client.close()

x402 Signer Authentication

from attago import AttaGoClient

client = AttaGoClient(signer=my_wallet_signer)
score = await client.agent.get_score("BTC")

Cognito Authentication

from attago import AttaGoClient

client = AttaGoClient(
    email="user@example.com",
    password="...",
    cognito_client_id="abc123",
)
await client.auth.sign_in()
profile = await client.data.get_latest()

API Reference

Service Methods
client.agent get_score(symbol), get_data(*symbols)
client.data get_latest(), get_token_data(token), get_data_push(request_id)
client.subscriptions catalog(), list(), create(input), update(sub_id, input), delete(sub_id)
client.payments subscribe(input), status(), upgrade_quote(tier, cycle)
client.wallets register(input), list(), remove(address)
client.webhooks create(url), list(), delete(id), send_test(opts), send_server_test(id)
client.mcp initialize(), list_tools(), call_tool(name, args), ping()
client.api_keys create(name), list(), revoke(key_id)
client.bundles list(), purchase(input)
client.push list(), create(input), delete(sub_id)
client.redeem redeem(code)

Webhook Listener

from attago import WebhookListener

listener = WebhookListener(secret="whsec_...", port=4000)
listener.on_alert(lambda p: print(f"{p.alert.token}: {p.alert.state}"))
listener.on_test(lambda p: print("Test received"))
listener.start()

Signature Verification

from attago import verify_signature

body = request.body  # raw bytes
signature = request.headers["X-AttaGo-Signature"]
if verify_signature(body, webhook_secret, signature):
    # valid

Error Handling

from attago import AttaGoClient, ApiError, PaymentRequiredError, RateLimitError

try:
    score = await client.agent.get_score("BTC")
except PaymentRequiredError as e:
    print(f"Payment needed: {e.payment_requirements}")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")
except ApiError as e:
    print(f"API error {e.status_code}: {e.message}")

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

attago-0.1.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

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

attago-0.1.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file attago-0.1.0.tar.gz.

File metadata

  • Download URL: attago-0.1.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attago-0.1.0.tar.gz
Algorithm Hash digest
SHA256 291f87a9176440f61f7c7c2fbbac552a820677bc2da7a9d4d2b2d5ae0fe4f677
MD5 0549df7517c355420bf7e115baaccb19
BLAKE2b-256 a9e2e0f0e815f9c4d49bedba451a83ef736a834697863007a72c65bbc6f8afe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for attago-0.1.0.tar.gz:

Publisher: publish.yml on AttaGo/attago-py-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file attago-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: attago-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attago-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e3f38ca0d4f3ec311d4745fd58fa144009c033cd0f933eeaa71ef0b47b18c37
MD5 83e5e6daa926524dcf669fd9774f77dc
BLAKE2b-256 a27ef4f3e58e431c191f12c303edf1e38eee5dad017de4db8808910e11baba1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for attago-0.1.0-py3-none-any.whl:

Publisher: publish.yml on AttaGo/attago-py-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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