Skip to main content

Python SDK for Arkham Exchange API

Project description

Arkham Exchange Python SDK

A Python client library for the Arkham Exchange API, providing both REST and WebSocket interfaces for trading cryptocurrency and managing your account.

Installation

Install the SDK using pip:

pip install arkham-sdk-python

Basic Usage

REST API Client

from arkham_sdk_python.client import Arkham

# Initialize the client with your API credentials
client = Arkham(
    api_key="your_api_key",
    api_secret="your_api_secret"
)

# Get trading pairs
pairs = client.get_pairs()
print(f"Available pairs: {pairs}")

# Get order book for a specific pair
orderbook = client.get_orderbook(symbol="BTC_USDT")
print(f"Order book: {orderbook}")

# Place a limit order
order = client.create_order(
    {
        "symbol": "BTC_USDT",
        "side": OrderSide.Buy,
        "type": OrderType.LimitGtc,
        "size": "0.0001",
        "price": "30000",
    }
)
print(f"Order placed: {order}")

WebSocket Client

from arkham_sdk_python.ws_client import ArkhamWebSocket
from arkham_sdk_python.models import WebsocketTradesUpdate

def handle_trade_update(update: WebsocketTradesUpdate):
    print(f"Trade update: {update}")

# Initialize WebSocket client
ws = ArkhamWebSocket(
    api_key="your_api_key",
    api_secret="your_api_secret"
)

# Connect and subscribe to trades
ws.connect()
ws.subscribe_trades("BTC-USD", handle_trade_update)

# Keep the connection alive
try:
    ws.wait()
except KeyboardInterrupt:
    ws.close()

Authentication

The SDK requires API credentials to access private endpoints:

  1. API Key: Your unique API key from Arkham Exchange
  2. API Secret: Your secret key for signing requests

You can obtain these credentials from your Arkham Exchange account dashboard.

Examples

For more detailed usage examples, see the examples/ directory:

These examples demonstrate:

  • Authentication and client initialization
  • Fetching market data (pairs, order books, trades)
  • Placing and managing orders
  • Real-time data streaming via WebSocket
  • Error handling and best practices

Features

  • REST API Client: Full access to Arkham Exchange REST endpoints
  • WebSocket Client: Real-time streaming of market data and order updates
  • Type Safety: Complete type annotations for better development experience
  • Error Handling: Comprehensive exception handling for API errors
  • Authentication: Built-in request signing for private endpoints

Requirements

  • Python 3.8 or higher
  • requests >= 2.25.0
  • websocket-client >= 1.0.0
  • typing_extensions >= 4.0.0

Contributing

This SDK is automatically generated from the Arkham Exchange API specification. The majority of the code is generated automatically to ensure consistency with the API.

For suggestions, bug reports, or feature requests, please:

  1. Open a GitHub Issue: Report bugs or request features via GitHub issues
  2. Provide Details: Include relevant error messages, code snippets, and expected behavior
  3. API Changes: For API-related changes, note that modifications may need to be made to the API specification rather than the SDK directly

We welcome feedback and will work to address issues promptly!

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Support

For technical support or questions:

  • GitHub Issues: Report bugs and request features
  • Documentation: Refer to the Arkham Exchange API documentation
  • Examples: Check the examples/ directory for usage patterns

Note: This SDK is in active development. Please check the releases page for the latest updates and changelog.

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

arkham_sdk_python-0.1.2.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

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

arkham_sdk_python-0.1.2-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file arkham_sdk_python-0.1.2.tar.gz.

File metadata

  • Download URL: arkham_sdk_python-0.1.2.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for arkham_sdk_python-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6603b927de5071182a621f11f233aa083015e3c0b0ab607ab3c12cf84ef02546
MD5 56d97b3a9faebb0cea16507f241ffd27
BLAKE2b-256 982cebddb8c966925187eb3721d7a7ddaf23c05fe741ec47b14d0f9e81d6e08e

See more details on using hashes here.

File details

Details for the file arkham_sdk_python-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for arkham_sdk_python-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce26b88e3fc57eb6488efcc5dbaa3bbdedd3c7bb83a03fcd81caf473132a92d
MD5 a933fbf78238327bb99c9329d2e7a556
BLAKE2b-256 3c0d69f556cd730007dd322cf6d0325c59316a9ebe2308c85cba145872ef685a

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