Skip to main content

Atraxis Python SDK

Официальный SDK для владельцев гильдий и лавок Atraxis. Он помогает подключить к гильдии своего бота, сайт или учётную систему: посмотреть склад, работать с внутренними валютами, выдавать ценности игрокам и получать историю операций.

pip install atraxis-sdk

Требуется Python 3.10 или новее. Перед началом лидер гильдии выпускает приватный токен в разделе «Интеграции гильдии». Храните его как пароль: токен даёт доступ к операциям вашей гильдии.

Быстрый старт

from atraxis import AtraxisClient, CurrencyTransfer

with AtraxisClient("agk_example.redacted") as client:
    for item in client.iter_warehouse():
        print(item.warehouse_item_id, item.name, item.quantity)

    result = client.transfer(
        [CurrencyTransfer.to_player("TOKEN", player_id=100001, amount=25)],
        idempotency_key="order-2026-09-12-0001",
    )
    print(result.operation_id)

Асинхронный клиент имеет те же методы:

import asyncio
from atraxis import AsyncAtraxisClient


async def main() -> None:
    async with AsyncAtraxisClient("agk_example.redacted") as client:
        async for event in client.iter_activity():
            print(event.occurred_at, event.kind, event.net)


asyncio.run(main())

Токен и адрес можно передать через ATRAXIS_API_TOKEN и ATRAXIS_API_BASE_URL. По умолчанию SDK обращается к основному серверу Atraxis. Токен не включается в repr, исключения или логи самого SDK.

Что умеет SDK

  • get_warehouse, iter_warehouse — склад гильдии;
  • list_currencies, upsert_currency — внутренние валюты;
  • get_balances — балансы игрока;
  • transfer — единая операция из 1–10 переводов;
  • get_activity, iter_activity — история операций гильдии.

Все суммы представлены в Python как int, а по сети передаются десятичными строками. Модели неизменяемы. Новые необязательные поля ответа не ломают клиент, но обязательные поля всегда проверяются.

Переводы

from atraxis import CurrencyTransfer, ItemTransfer

parts = [
    ItemTransfer(warehouse_item_id=700001, player_id=100001, amount=1),
    CurrencyTransfer.issue("TOKEN", amount=100),
    CurrencyTransfer.retire("TOKEN", amount=10),
    CurrencyTransfer.to_player("TOKEN", player_id=100001, amount=25),
    CurrencyTransfer.from_player("TOKEN", player_id=100001, amount=5),
    CurrencyTransfer.between_players(
        "TOKEN",
        from_player_id=100001,
        to_player_id=100002,
        amount=3,
    ),
]

Передавайте в idempotency_key постоянный идентификатор перевода или заказа. Если ключ не задан, SDK создаст UUID и вернёт его в TransferResult.idempotency_key. Повторный POST внутри SDK использует тот же ключ.

Транспортные ошибки, 429, 502, 503 и 504 повторяются не более двух раз. При 429 учитывается Retry-After. Ошибки API представлены AtraxisAPIError; в них доступны безопасный problem response и request_id.

Полная интерактивная документация: https://atraxisonline.com/developers/api.

Как пополняется склад

Свой склад пополняют на странице гильдии или через основной бот. В привязанном чате гильдии используйте Внести …. В любом чате Авроры, где работает обычное Передать, можно выбрать склад любой гильдии по её уникальному тегу:

Передать {ТЕГ} Стабилизатор - 2 штуки
Передать {ТЕГ} 1000 кредитов; номер 4 - 2 штуки

Команда с тегом не работает в общем чате. Для неё не нужны reply, пересланное сообщение или членство в выбранной гильдии.

Через API их можно только выдавать со склада игрокам. Списать их у игрока через API нельзя.

Подключение к Codex и Claude Code

pip install "atraxis-sdk[mcp]"

MCP позволяет Codex и Claude Code подсказывать по API и работать с вашей гильдией через SDK. Без токена помощник отвечает только по документации. С ATRAXIS_API_TOKEN он сможет читать данные гильдии. Команды, которые меняют валюты или передают ценности, доступны только после запуска с --allow-writes; для каждого перевода потребуется idempotency_key.

Codex в режиме только для чтения, с уже установленной переменной окружения:

[mcp_servers.atraxis]
command = "atraxis-mcp"
env_vars = ["ATRAXIS_API_TOKEN"]

Или через CLI:

codex mcp add atraxis --env ATRAXIS_API_TOKEN="$ATRAXIS_API_TOKEN" -- atraxis-mcp

Claude Code:

claude mcp add --transport stdio --env ATRAXIS_API_TOKEN="$ATRAXIS_API_TOKEN" atraxis -- atraxis-mcp

Готовые конфигурации без токенов лежат в examples/mcp. Чтобы разрешить изменения, добавьте --allow-writes в args только на своём устройстве и только для помощника, которому доверяете.

Лицензия

MIT.

Metadata

Release files for atraxis-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atraxis-sdk 0.1.1
File Size Uploaded Provenance Actions
atraxis_sdk-0.1.1.tar.gz 29.7 kB With provenance Details for atraxis_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atraxis-sdk 0.1.1
File Interpreter ABI Platform Actions
atraxis_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for atraxis_sdk-0.1.1-py3-none-any.whl

Total release size: 57.0 kB

Release files / atraxis_sdk-0.1.1.tar.gz

Download URL atraxis_sdk-0.1.1.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c309b7b9e3cd5c16964c0a3b926305e6064485425e2bf16764755f26346cef4b
BLAKE2b-256 checksum
How to use checksums
6f085613cddd3cd6d3ba31466d94b288bd27876c73fb68055b037371fcb243d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / atraxis_sdk-0.1.1-py3-none-any.whl

Download URL atraxis_sdk-0.1.1-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80fd2d534528f89dfc82319cc3f1926b0dddc2f0c751fdd4cc57a65d967a3ac4
BLAKE2b-256 checksum
How to use checksums
a4050eb75e8b5a69cd8af5e1a27d0d5841ee9541c4c95864284df3eca3f73c35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Security for atraxis-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atraxis_sdk-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page