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 system | Architectures |
|---|---|
| Linux | x86_64, aarch64 |
| macOS | arm64 (Apple silicon), x86_64 (Intel) |
| Windows | x86_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]"
| Extra | Installs | Needed for |
|---|---|---|
arrow | pyarrow | reading a run's output tables with pyarrow |
rl | NumPy and Gymnasium | tradefloor.gym, the gym environment |
mcp | the MCP SDK and pyarrow | the tradefloor-mcp server (Local MCP server) |
openai-agents | the OpenAI Agents SDK | the OpenAI Agents adapter, in live mode |
pydantic-ai | pydantic-ai-slim | the PydanticAI adapter, in live mode |
langgraph | LangGraph | the LangGraph adapter, in live mode |
finrobot | FinRobot and its dependencies | the FinRobot adapter, in live mode. Python 3.11 only |
claude | the Anthropic SDK and Pydantic | the 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.