Skip to main content
The Molecule Python SDK gives you a typed, authenticated client for placing orders, streaming real-time data, and managing portfolio state across prediction market venues. It handles Ed25519 request signing, WebSocket connections, and error mapping so you can focus on your trading logic.

Requirements

The SDK requires Python 3.10 or later. The following dependencies are installed automatically — you do not need to install them separately.

Install from PyPI

Install the latest stable release using pip:

Install from GitHub (Pre-release)

To install the latest unreleased version directly from the main branch:

Verify Installation

Confirm the package is installed and check the version:

Environment Variables

The SDK reads configuration from environment variables when values are not passed explicitly to the constructor. Use these to keep credentials out of source code. Store your credentials in a .env file at the root of your project:
Load the file before constructing the client using python-dotenv:
base_url is always required. Set it via the MOLECULE_BASE_URL environment variable or pass it directly as the base_url argument to the constructor. The SDK raises a ValueError at construction time if neither is provided.