Skip to main content

Paradex Python SDK

Release Build status codecov Commit activity License

Paradex Python SDK provides a simple interface to interact with the Paradex REST and WS API.

Examples

L1 + L2 Authentication (Traditional)

from paradex_py import Paradex
from paradex_py.environment import Environment

paradex = Paradex(env=Environment.TESTNET, l1_address="0x...", l1_private_key="0x...")
print(hex(paradex.account.l2_address)) # 0x...
print(hex(paradex.account.l2_public_key)) # 0x...
print(hex(paradex.account.l2_private_key)) # 0x...

L2-Only Authentication (Subkey)

from paradex_py import ParadexSubkey
from paradex_py.environment import Environment

# Use ParadexSubkey for L2-only authentication
paradex = ParadexSubkey(
    env=Environment.TESTNET,
    l2_private_key="0x...",
    l2_address="0x..."
)
print(hex(paradex.account.l2_address)) # 0x...
print(hex(paradex.account.l2_public_key)) # 0x...
print(hex(paradex.account.l2_private_key)) # 0x...

WebSocket Usage

The SDK provides two WebSocket client options:

Option 1: Async Client (Default)

Use the async client when you're comfortable with asyncio and need maximum performance:

async def on_message(ws_channel, message):
    print(ws_channel, message)

await paradex.ws_client.connect()
await paradex.ws_client.subscribe(ParadexWebsocketChannel.MARKETS_SUMMARY, callback=on_message)

Option 2: Threaded Client (Synchronous)

Use the threaded client for simpler integration without asyncio knowledge:

from paradex_py.api.ws_client_threaded import ThreadedParadexWebsocketClient
from paradex_py.api.ws_client import ParadexWebsocketChannel
from paradex_py.environment import TESTNET

# Simple synchronous usage - no asyncio required
ws_client = ThreadedParadexWebsocketClient(env=TESTNET)

with ws_client:
    ws_client.subscribe(ParadexWebsocketChannel.MARKETS_SUMMARY)

    # Blocking call - waits for messages
    msg = ws_client.get_updates(timeout=5.0)
    if msg:
        print(f"Channel: {msg.channel}, Data: {msg.data}")

When to use which:

Feature Async Client Threaded Client
Asyncio knowledge Required Not required
Integration Async codebases Synchronous codebases
Performance Optimal Good
Complexity Higher Lower
Runtime subscription Via callbacks Via subscribe() anytime

📖 For complete documentation refer to tradeparadex.github.io/paradex-py

💻 For comprehensive examples refer to following files:

Development

make install
make check
make test
make build
make clean-build
make publish
make build-and-publish
make docs-test
make docs
make help

Using uv

This project uses uv for managing dependencies and building. Below are instructions for installing uv and the basic workflow for development outside of using make commands.

Installing uv

uv is a fast and modern Python package manager. You can install it using the standalone installer for macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

For other installation methods, refer to the uv installation documentation.

Basic Workflow with uv

If you prefer not to use make commands, you can directly use uv for development tasks:

  • Install dependencies: Sync your environment with the project's dependencies.
    uv sync
    
  • Run tests: Execute the test suite using pytest within the uv environment.
    uv run pytest
    
  • Build the project: Create a distribution package for the SDK.
    uv build
    

For more detailed information on using uv, refer to the uv documentation.

The CI/CD pipeline will be triggered when a new pull request is opened, code is merged to main, or when new release is created.

Notes

[!WARNING] Experimental SDK, library API is subject to change

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paradex_py-0.7.0.tar.gz (436.4 kB view details)

Uploaded Source

Built Distribution

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

paradex_py-0.7.0-py3-none-any.whl (154.6 kB view details)

Uploaded Python 3

File details

Details for the file paradex_py-0.7.0.tar.gz.

File metadata

  • Download URL: paradex_py-0.7.0.tar.gz
  • Upload date:
  • Size: 436.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for paradex_py-0.7.0.tar.gz
Algorithm Hash digest
SHA256 cc3dc37c73869ac4facad4f1e65b892039191e44269709653f1103bf393076d6
MD5 307783617f722aa82aaeec125ad878bb
BLAKE2b-256 4bd7d65e9627ce3a3d5ce30d2f836348dfcee16ff0dffa405f7fd11b12066f23

See more details on using hashes here.

File details

Details for the file paradex_py-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: paradex_py-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 154.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for paradex_py-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b6f4e3eac2e093f9f3edf6c1cf80d2f54938eefa44327621b6eb3d1f60b1b38
MD5 dd4c37b7e45d87758cd4e00a59e2b215
BLAKE2b-256 864670b4b84b48a53b2578b4f0c38d3cf8ca2ad848b4cb9a00d40538d364bb4a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.9

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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