Skip to the page

Install

pip install tradefloor

The package has no required dependencies. Everything that needs another library, such as the MCP server or the Gymnasium environment, is an optional extra.

Requirements

tradefloor needs CPython 3.11 or later. Each release is tested on 3.11, 3.12 and 3.13, and ships prebuilt wheels for five targets:

Operating systemArchitectures
Linuxx86_64, aarch64
macOSarm64 (Apple silicon), x86_64 (Intel)
Windowsx86_64

On any other platform pip builds the package from source, which needs a Rust toolchain. The same engine is a Rust crate, added with cargo add tradefloor.

Every release runs the same fixed simulations on all five targets before it is published and stops if any result differs, so a seed gives the same market on each of them. Reproducibility says what that check covers and what it leaves out.

Checking the install

import tradefloor as tf

print(tf.__version__)
print(tf.preset_record()["preset"])
0.8.7
pt-v20

The first line is the package version. The second is the default preset, the set of model coefficients a market runs on when you do not name one.

Optional extras

Name an extra in square brackets. Quote the argument, because some shells read the brackets themselves:

pip install "tradefloor[mcp]"
ExtraInstallsNeeded for
arrowpyarrowreading a run's output tables with pyarrow
rlNumPy and Gymnasiumtradefloor.gym, the gym environment
mcpthe MCP SDK and pyarrowthe tradefloor-mcp server (Local MCP server)
openai-agentsthe OpenAI Agents SDKthe OpenAI Agents adapter, in live mode
pydantic-aipydantic-ai-slimthe PydanticAI adapter, in live mode
langgraphLangGraphthe LangGraph adapter, in live mode
finrobotFinRobot and its dependenciesthe FinRobot adapter, in live mode. Python 3.11 only
claudethe Anthropic SDK and Pydanticthe example examples/08-claude-agent.py

The output tables are Arrow tables, so polars, pandas and duckdb read them too, and you need the arrow extra only if you want pyarrow itself.

The framework adapters need their framework only to call a model. Replaying a recorded run needs none of them, so a plain pip install tradefloor replays a recording. In live mode, an adapter whose framework is missing raises MissingDependencyError, an ImportError whose message gives the pip install command for the extra.

Pinning a version

The API can change in any release before 1.0, so pin the version you tested with:

pip install "tradefloor==0.8.7"

A pinned version also pins the default preset. Support policy says what a patch release may change and how long a release line gets fixes.

Examples and notebooks

The numbered examples and notebooks are in the GitHub repository, and the package does not include them. Clone the repository to run them. Some of them read recorded runs from its tests/fixtures/ folder.

If an install or an import fails, see Troubleshooting.