Skip to main content

ironcondor (Python bindings)

Python bindings for ironcondor, a high-performance options-strategy backtester with order-book-level fill simulation, built on optionstratlib.

Status: v0.5.0, published. The backtest API (BacktestConfig, run, Bundle) is wired over the same Rust engine, and the typed exception hierarchy landed with #40: IronCondorError is the base, with ConfigError, DataError, ExecutionError, StrategyError, BundleError, and EngineError beneath it (ConfigError is also a ValueError; DataError and BundleError are also OSError), and no panic crosses the FFI boundary. The distribution is on PyPI as ironcondor: pip install ironcondor. The 0.5.0 upload carries the macOS arm64 cp310-abi3 wheel plus the sdist; on Linux and macOS x86_64 pip builds from the sdist for now, which needs a Rust toolchain.

import ironcondor as ic

cfg = (
    ic.BacktestConfig(seed=42, capital_cents=1_000_000)   # $10,000, integer cents
      .data_parquet("chains/spx_2025.parquet")
      .strategy_iron_condor(
          underlying="SPX",
          underlying_price_cents=500_000,
          short_call_strike_cents=510_000, long_call_strike_cents=520_000,
          short_put_strike_cents=490_000,  long_put_strike_cents=480_000,
          expiration_ns=1_752_883_200_000_000_000,
          quantity=1,
          premium_short_call_cents=2_000, premium_short_put_cents=1_800,
          premium_long_call_cents=800,    premium_long_put_cents=700,
      )
      .exit_profit_percent(0.5)            # optionstratlib ExitPolicy
      .execution_naive(slippage_cents=5)   # or .execution_realistic()
      .fees(per_contract_cents=65, per_order_cents=100)
)

bundle  = ic.run(cfg)              # releases the GIL; runs the Rust engine AND
                                   # atomically writes <output_dir>/<run_id>/
print(bundle.path)                 # the on-disk bundle directory run() published
equity  = bundle.equity_curve()    # -> pandas.DataFrame  (needs the [pandas] extra)
metrics = bundle.metrics()         # -> dict (from manifest.json)

reopened = ic.load_bundle(bundle.path)   # validated through the hardened reader

Money crosses the boundary as integer cents (*_cents); the only floats are the analytic exception (implied volatility, the two rates, ExitPolicy percentages). Only what the engine wires end to end is exposed — a Parquet source and the iron condor strategy; a CSV source and the short strangle are not yet reachable through the binding.

DataFrame accessors (optional pandas extra)

bundle.fills(), .equity_curve(), .positions(), .greeks_attribution() return pandas DataFrames read lazily from the on-disk Parquet. pandas (and its pyarrow engine) is an optional soft dependency:

pip install ironcondor[pandas]

run(), load_bundle, metrics(), and bundle.path work without it — and because the bundle is plain Parquet + JSON, polars / pyarrow can read bundle.path directly instead.

Building locally

Wheels are built with maturin using the abi3 stable ABI, so one cp310-abi3 wheel per platform serves Python 3.10+. The published wheel is a self-contained backtester — python (bindings) plus orderbook (realistic execution) plus simulator (the synthetic-chain feed):

# from this directory (python/)
maturin build --release --features "python orderbook simulator"
# or, for an editable install into the current interpreter:
maturin develop --features "python orderbook simulator"

The crate manifest lives at the repository root; pyproject.toml points maturin at it via manifest-path = "../Cargo.toml", and its [tool.maturin] features already lists the same set (plus pyo3/extension-module), so a bare maturin build --release produces the same wheel.

Releases and PyPI status

ironcondor is published on PyPI; the name is registered and publishing stays a deliberate, owner-approved action (docs/06 §8, CLAUDE.md).

  • On every pipeline, CI (.github/workflows/ci.yml, job python-wheels) builds and pytest-runs a cp310-abi3 wheel on Linux + macOS.
  • On a v* tag, the release workflow (.github/workflows/release.yml) builds release-grade wheels (Linux manylinux, macOS x86_64, macOS arm64) plus an sdist, then publishes to PyPI via trusted publishing (OIDC, no token), behind a manually-approved GitHub pypi environment. Windows wheels remain a deferred wishlist item.
  • Known gap at 0.5.0. The index carries only the macOS arm64 wheel and the sdist: the wheel matrix failed on the v0.5.0 tag run and the fix (bd7313d) landed after it, so the Linux and macOS x86_64 wheels still owe a green release run.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ironcondor-0.7.0.tar.gz (396.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ironcondor-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ironcondor-0.7.0-cp310-abi3-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ironcondor-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ironcondor-0.7.0.tar.gz.

File metadata

  • Download URL: ironcondor-0.7.0.tar.gz
  • Upload date:
  • Size: 396.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ironcondor-0.7.0.tar.gz
Algorithm Hash digest
SHA256 61a5b0318c7ab300b6ae466802b0b4fc6350ef6a65c66cc10f4917b6d0329f90
MD5 5ff4029cb6824f9fd36cae1a23b6515a
BLAKE2b-256 fda894d3a5eb501cab428bf5f5443d14ee4c8bec97667ae982eb0cfed1e3d31b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.7.0.tar.gz:

Publisher: release.yml on joaquinbejar/IronCondor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ironcondor-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ironcondor-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4c5c461deeabacff5c8c96e2614991f49e7f906a4b3f334566c9764b623470a
MD5 a0450f81c8e69a8b014c19b8cc6b45a8
BLAKE2b-256 5a1002b40fe023b7213003b052dcdea7a5618ccdd8e9ad3f41a91b3e985df789

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on joaquinbejar/IronCondor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ironcondor-0.7.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ironcondor-0.7.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7eafadca85b492f9d84bdfb6de18d642d5cbc2d1b8a04b76d6afc77d06c61c65
MD5 0e2e48486a4445b401cc793ea5c8bd34
BLAKE2b-256 affb09642deedf97a64958a843cf4c83d644f2d2b7c485eb68fb537b6bb32ed6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.7.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on joaquinbejar/IronCondor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ironcondor-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ironcondor-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8eafff554a93ac09356546a0367eceb9d4d811e63c1844b0bddb730714aa274f
MD5 0ef3d7db043a0a4cebefea7dc08c17aa
BLAKE2b-256 d9df6198c2e21abf748b79ee01a63fdc361e2870a49861c675a07c4251f804a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on joaquinbejar/IronCondor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.7.0 This release

4 files

0.6.0

4 files

0.5.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page