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.

Metadata

Release files for ironcondor 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ironcondor 0.10.0
File Size Uploaded Provenance Actions
ironcondor-0.10.0.tar.gz 398.2 kB With provenance Details for ironcondor-0.10.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ironcondor 0.10.0
File Interpreter ABI Platform Actions
ironcondor-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for ironcondor-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ironcondor-0.10.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for ironcondor-0.10.0-cp310-abi3-macosx_11_0_arm64.whl
ironcondor-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for ironcondor-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 9.8 MB

Release files / ironcondor-0.10.0.tar.gz

Download URL ironcondor-0.10.0.tar.gz
Size 398.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ed37a51946f21a1b6656af238026b936286735773cb5c2224dc829fcbdf33372
BLAKE2b-256 checksum
How to use checksums
41145165c277a2f054590f2d8a824017ebf22a9281a8346139ba579d974833a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / ironcondor-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ironcondor-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
af6eb9810895e9e9ac5fab452f1be22fe27330136dad6b6ece192e8480d82763
BLAKE2b-256 checksum
How to use checksums
c5c93977b182ada310ce9e5b5263b60b38e0d1857c543b6d0492a726043fff08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / ironcondor-0.10.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL ironcondor-0.10.0-cp310-abi3-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
64827bb40cd68decdaef4cb140f90b08491a0bb4cdcc6e479f797dfca7c1905e
BLAKE2b-256 checksum
How to use checksums
798055a2a1ad6075da4bce9b0d0a9d44b39a4c5dfc75b6098232676b6cf12fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / ironcondor-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ironcondor-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
56148d8a429a7d21cee81a6e5ab976efc9857a65d4987fd7d7dace35d95d440b
BLAKE2b-256 checksum
How to use checksums
4b460f8cce7b6e36bea36a25f1ad871ea5d3696a64a26ea2daa65fddbbcdddd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for ironcondor 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for ironcondor-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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