Paradex Python SDK
Project description
Paradex Python SDK
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
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)
📖 For complete documentation refer to tradeparadex.github.io/paradex-py
💻 For comprehensive examples refer to following files:
- API (L1+L2): examples/call_rest_api.py
- API (L2-only): examples/subkey_rest_api.py
- WS (L1+L2): examples/connect_ws_api.py
- WS (L2-only): examples/subkey_ws_api.py
- Transfer: examples/transfer_l2_usdc.py
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
pytestwithin theuvenvironment.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paradex_py-0.5.4.tar.gz.
File metadata
- Download URL: paradex_py-0.5.4.tar.gz
- Upload date:
- Size: 246.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4960d684e7e01ea3d5ebc6f84b9ec2d5184d7c2a6ccac8de58d457da69727907
|
|
| MD5 |
8fc7fe68e0f486cd1a763b2385669ab8
|
|
| BLAKE2b-256 |
c2c2c7ac63d647d996d3e39f8b5cf41875389229f454495df47b975e6546e20e
|
File details
Details for the file paradex_py-0.5.4-py3-none-any.whl.
File metadata
- Download URL: paradex_py-0.5.4-py3-none-any.whl
- Upload date:
- Size: 68.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1026f00389edfa697f8d0ae78359fbf8f11e5c2b538d0a81758516982cf288
|
|
| MD5 |
f0f4fe382487050f45a76a85d1e752a1
|
|
| BLAKE2b-256 |
031b6dac9b3480123cc325d3770d5489269ad99b149fd0db19aaabb892a6cd56
|