Skip to main content

Arco Python bindings

The Python package remains in bindings/python for path compatibility with existing build, release, and editable-install workflows. Its Rust crate is named arco-python and is the Python interaction surface; public Python imports stay under arco.

Python-facing solve orchestration is routed through the shared arco-ops facade where it overlaps with other interaction surfaces. The public Python API remains under arco.

Write a Python-built model to LP format with the shared exporter:

from pathlib import Path

import arco

model = arco.Model()
x = model.add_variable(bounds=arco.NonNegativeFloat, name="x")
model.add_constraint(x >= 1.0, name="minimum")
model.minimize(x, name="cost")

output_path = Path("model.lp")
model.write_lp(output_path)

write_lp accepts a string or any os.PathLike[str], overwrites the target, and returns None.

Build and install locally with the repository solver setup:

just py-dev

Default Python builds include HiGHS, SCIP, and the runtime-loaded Xpress backend. Solving with arco.Xpress(...) still requires the FICO Xpress runtime and a valid license on the target machine.

For direct maturin workflows, run through the solver build environment so the bindings link against the cached HiGHS and SCIP distributions:

cd ../..
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 ARCO_HIGHS_ENABLE_APPLE_STATIC=1 ./scripts/with_solver_build_env.sh \
  bash -lc 'cd bindings/python && uv sync --group dev && ./.venv/bin/maturin develop'

CARGO_INCREMENTAL=0 and CARGO_PROFILE_DEV_DEBUG=0 are intentional for cold editable builds: they avoid incremental bookkeeping and debug-info generation that slow a clean maturin develop build. Leave them unset for normal Rust edit-compile-test loops where incremental rebuilds and debug info help.

To enable the IPOPT nonlinear backend, build with the ipopt feature (requires a system IPOPT install):

cd bindings/python
uv run --with maturin maturin develop --features ipopt

To disable optional commercial or native solver features for a source build, turn off default Cargo features and opt back into the backends you need:

cd bindings/python
uv run --with maturin maturin develop --no-default-features --features pyo3/extension-module

Without a solver feature, that solver's Python class remains importable but solve will fail fast with a rebuild hint.

Run linting from the repository root so the project-pinned tool versions are used:

just py-lint-check
just py-type

Run Python example formulations from the repository root:

cd ../..
uv run examples/dense-lp/formulation.py --solve --json
uv run examples/sdom/formulation.py --solve --json

For interactive exploration of dense-lp (no extra script boilerplate):

cd ../..
uv run --with ipython --with-editable ./bindings/python ipython -i examples/dense-lp/formulation.py

Inside IPython, use model to inspect the formulation and call solve() when ready.

Running example problems

The examples/ tree contains standalone Python scripts that build models directly through the bindings, covering different problem classes:

  • LP — linear programs (default HiGHS backend).
  • MILP — mixed-integer linear programs (HiGHS).
  • NLP — nonlinear programs (requires bindings built with --features ipopt).
  • QP / QCP — (quadratically constrained) quadratic programs, solved through the appropriate backend for the problem class.

Run from bindings/python so the locally built extension is on the import path:

cd bindings/python

# LP — Multi-period DC-OPF (HiGHS)
uv run python ../../examples/multi-period-optimal-power-flow/dc-opf-24bus-wind-load-shedding/problem.py

# NLP — Multi-period AC-OPF (IPOPT)
uv run python ../../examples/multi-period-optimal-power-flow/ac-opf-24bus-wind-load-shedding/problem.py

Each script prints the solver status and final objective value alongside the reference value from the original formulation. Substitute the path to any other problem.py (or formulation.py) under examples/ to run a different model.

Metadata

Release files for arco 0.13.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 arco 0.13.0
File Size Uploaded Provenance
arco-0.13.0.tar.gz 2.4 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for arco 0.13.0
File
arco-0.13.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
arco-0.13.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
arco-0.13.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
arco-0.13.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
arco-0.13.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
arco-0.13.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 24.8 MB

Release files / arco-0.13.0.tar.gz

Download URL arco-0.13.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
1d9bda9691a613117daae1542f82ff08177862d530136a411bf42a71ef054049
BLAKE2b-256 checksum
How to use checksums
f6ea3c894d5d8968d489a2a863499383e7257c83ee3e2c3c9f36c500fe76dc02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp311-abi3-win_amd64.whl

Download URL arco-0.13.0-cp311-abi3-win_amd64.whl
Size 3.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
655c17204d409d75b21eacada96ae793feecd0ea21458baf944ada0cc95c4a90
BLAKE2b-256 checksum
How to use checksums
90bc16db3ef117a0e6a66243f446bf7f30f84075d177c18943db4d11bfe80be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL arco-0.13.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 4.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
620ec86cbec8bdae0a44a3e2f9662a85a1b0bd4759d4ead7636c227c9cb8dab5
BLAKE2b-256 checksum
How to use checksums
42b0c1b7066926cdc04f39c6195252ad2e4c4ca5620e4d1880f00791fdc735e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL arco-0.13.0-cp311-abi3-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4b802308d20e1b5a0c2c3742b03cbad718d50af67d4b13598084b710cf8cbc2b
BLAKE2b-256 checksum
How to use checksums
c1c27f3187e44800a9b2e9391179bd01ea7982c5cfd22cfc25fb53eb4a042d95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp310-cp310-win_amd64.whl

Download URL arco-0.13.0-cp310-cp310-win_amd64.whl
Size 3.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fb2997db3f4f11d26f252b936145e41bb660534481e3b275d5472768beed3e1b
BLAKE2b-256 checksum
How to use checksums
39c80d9d6f815f86c9cea2bfd15fded290f21dc08a8e8c4a8daf2fb9faaf7656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL arco-0.13.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 4.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d194124c3d8d4c663479027f125030a72c357b2d0538452409ba6a5dd6b8676b
BLAKE2b-256 checksum
How to use checksums
6553de987d923ea30672e772753ba4152c03021d77236507f1dde721bc335575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Release files / arco-0.13.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL arco-0.13.0-cp310-cp310-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d10808d0761a4efe94f81d14c82717e8b24a9c2b094fc098bf3a953e17d79569
BLAKE2b-256 checksum
How to use checksums
074cf26f795130cd003b98289ea13bb9a3437a23e94eb07fb0e45b09a4ec707c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 8, 2026.

Transparency log

Security for arco 0.13.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 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for arco-0.13.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 Sep 8, 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