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. Releases are tested on 3.11, 3.12 and 3.13 and ship 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, and for that you need a Rust toolchain. To use the engine from Rust, run cargo add tradefloor, and see Embedding the engine for running it inside your own app or game.

Before a release is published, it runs a fixed set of simulations on all five targets and stops if any result differs, so a seed gives you the same market on any 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.11.0
pt-v22

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. You can read them with polars, pandas or duckdb, and you only need the arrow extra if you want pyarrow itself.

An adapter needs its framework only when it calls a model. A plain pip install tradefloor can replay a recorded run. In live mode, an adapter whose framework isn't installed raises MissingDependencyError. That's an ImportError, and its message gives the pip install command for the extra.

Pinning a version

Before 1.0 the API can change in any minor release. Pin the version you tested with:

pip install "tradefloor==0.11.0"

Pinning the version pins the default preset too. 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 aren't installed with the package. Clone the GitHub repository to run them. Some of them read recorded runs from its tests/fixtures/ folder.

If an install or an import fails, see Troubleshooting.