Back to knowledge
Engineering7 min read

Python & tooling

A practical Python research project structure

Keep data, experiments, reports, and production candidates separate so your research can be reproduced months later.

Separate inputs from outputs

A research project should distinguish raw data, cleaned data, configuration, source code, experiments, reports, and generated artefacts. This prevents a notebook output or edited CSV from silently becoming the new source of truth.

Use stable paths and a configuration file rather than hard-coding a different folder for every experiment.

Make experiments identifiable

Give each run a name or hash containing the strategy version, data version, parameters, and cost assumptions. Save the configuration next to the results. A chart without the inputs that produced it is not a durable research result.

  • Keep raw data read-only.
  • Store environment and dependency versions.
  • Write a small report for every accepted or rejected experiment.
  • Prefer scripts that can be run from a clean checkout.

Notebooks are for exploration

Notebooks are excellent for visual inspection and idea generation, but important transformations should move into tested functions or modules. That reduces hidden state and makes a result easier to rerun.

Keep the final experiment command visible in the report so another person can follow the path from data to conclusion.

Discuss this article

Ask a setup question, share a backtest, or compare notes with other algorithmic traders. Use a display name; your email remains private.

Create an account or sign in above to join the conversation.

Loading discussion…