Installation

Requirements

  • Python 3.10 or newer

  • A working C compiler (required by the coincurve dependency)

Install from PyPI

pip install o2-sdk

Install from source

git clone https://github.com/o2-exchange/sdks.git
cd sdks
pip install -e sdks/python

Development install

To install with development dependencies (linting, testing, type checking):

pip install -e "sdks/python[dev]"

Dependencies

The SDK uses the following runtime dependencies:

Package

Purpose

coincurve >=20.0.0

secp256k1 elliptic curve cryptography (key generation, signing)

aiohttp >=3.9.0

Async HTTP client for REST API calls

websockets >=12.0

WebSocket client for real-time data streams

pycryptodome >=3.20.0

Keccak-256 hashing (EVM address derivation)

Verifying the installation

import o2_sdk
print("o2-sdk installed successfully")

# Quick connectivity check
import asyncio
from o2_sdk import O2Client, Network

async def check():
    client = O2Client(network=Network.TESTNET)
    markets = await client.get_markets()
    print(f"Connected — {len(markets)} markets available")
    await client.close()

asyncio.run(check())