Skip to main content

Paradex Python SDK

Project description

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

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:

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

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

paradex_py-0.5.6rc3.tar.gz (349.2 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.5.6rc3-py3-none-any.whl (86.2 kB view details)

Uploaded Python 3

File details

Details for the file paradex_py-0.5.6rc3.tar.gz.

File metadata

  • Download URL: paradex_py-0.5.6rc3.tar.gz
  • Upload date:
  • Size: 349.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.5.6rc3.tar.gz
Algorithm Hash digest
SHA256 8a1a8fb9e4de9f5bb708d84237578fc4319e3b904b280a723560cdc0d7136845
MD5 1a83a833aabcaa60c371bdf5bbbe6a10
BLAKE2b-256 926f0508b66b84f0680b6fcf9339c64522eff05b7c57ed8d4d1ae0a21cb4d82b

See more details on using hashes here.

File details

Details for the file paradex_py-0.5.6rc3-py3-none-any.whl.

File metadata

  • Download URL: paradex_py-0.5.6rc3-py3-none-any.whl
  • Upload date:
  • Size: 86.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.5.6rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 b65883ea9747b2a54c94c4bf115f280ea9c1d6410e6bb0a19278b099fcd4b098
MD5 c33116cc3922d93936af776f5f44f4fb
BLAKE2b-256 c3352d0d795d8db08cfed664b3cb50b7a609b2d3175691d80913abc56070aea2

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