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.6.0.tar.gz (388.9 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.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

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

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

ironcondor-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for ironcondor-0.6.0.tar.gz
Algorithm Hash digest
SHA256 70b7c0dc7fdae621d9f4367a4ad384159b3be96a6b0ce127fc098c0b5e1a4c80
MD5 ea93bc8bda8418a2d9986f51e3514ea4
BLAKE2b-256 395c68352cf36158ea6d9b81f947f7351f97462488b3f8471b6f10ae142bf292

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.6.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.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ironcondor-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 daf67d690f2991b6d9b95b935938efb6fe9c1f7534529e6b1931726c7dc69377
MD5 0624fa87ab993b67a1fa397f1c0e0c86
BLAKE2b-256 92843085ed8863e6a0275df118f399b4ada81d7a8606749b6947be164e5c0b76

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.6.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.6.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ironcondor-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fa66b0fe01e88b3cfe13d64424cc87ed03d738b027cf91e342511416b993b19
MD5 ecea3a609c02766c528fccdba9d43bfd
BLAKE2b-256 2187cc556decbe83660c348846613dd2cedeb9ee62f186f912cc363c522ffd9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.6.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.6.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ironcondor-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8ce0c744bc6df8e3ce62d9dbfdef4f17feea626f0bcb401278bdbd08d2ef184f
MD5 7c802b9651afc29aeba1d8b9758d6bc0
BLAKE2b-256 8d341fe0db0b649dafd74ae44d5a9c3b23d7b17a9088cdfca686acd40288b8e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ironcondor-0.6.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

0.7.0

4 files

This release

0.6.0 This release

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