pip install project-x-py
Or using UV (recommended):
uv add project-x-py
git clone https://github.com/TexasCoding/project-x-py.git
cd project-x-py
pip install -e .
pip install "project-x-py[realtime]"
pip install "project-x-py[dev]"
pip install "project-x-py[all]"
Set your API credentials as environment variables:
export PROJECT_X_API_KEY="your-api-key" # pragma: allowlist secret
export PROJECT_X_USERNAME="your-username"
Or create a .env file:
PROJECT_X_API_KEY=your-api-key # pragma: allowlist secret
PROJECT_X_USERNAME=your-username
import asyncio
from project_x_py import TradingSuite
async def verify():
async with TradingSuite.create(["MNQ"]) as suite:
print(f"Connected to account: {suite.client.account_info.name}")
asyncio.run(verify())