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.14.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.14.0
File Size Uploaded Provenance
arco-0.14.0.tar.gz 2.4 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for arco 0.14.0
File
arco-0.14.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
arco-0.14.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
arco-0.14.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
arco-0.14.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
arco-0.14.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
arco-0.14.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.14.0.tar.gz

Download URL arco-0.14.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
f8c9740b3a2183993ebc68eb20eef74b130326cd8d284dc6f26897739469eedc
BLAKE2b-256 checksum
How to use checksums
a73fba0b65719efb80e86c0a3e4ff612a45f1c77271cf33d4a37c19a55df37cb
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 19, 2026.

Transparency log

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

Download URL arco-0.14.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
59ed2344343b672bd4edb0c94ce1e332128fc56ab5a9ea201ff0a814096e49d5
BLAKE2b-256 checksum
How to use checksums
af3e29277e0b32311a07a0e53f4f19bca980d16d030fbf222f73e6fcc5ccf988
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 19, 2026.

Transparency log

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

Download URL arco-0.14.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
3b1b36898300d000ba47d5dceff4fcb039e75876ca6933084afb451505f86110
BLAKE2b-256 checksum
How to use checksums
50c0de12bc1d7a504ad0bcff6860e0c4ba4f862089467d662e2863241e33fb9c
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 19, 2026.

Transparency log

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

Download URL arco-0.14.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
4469a87a2811b3a7556f9bbbf169cac3667bf829729071fb8bedbed386789f51
BLAKE2b-256 checksum
How to use checksums
4bca05715510121630189a4c48375aa9115829bcaaecbd38efcfe4075b9ed71c
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 19, 2026.

Transparency log

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

Download URL arco-0.14.0-cp310-cp310-win_amd64.whl
Size 3.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
31f5c2b3e50f790c58455c68d046147df09492701fd419fffcd8a119148ce3f2
BLAKE2b-256 checksum
How to use checksums
d340e118ad0562236264b73a01f157eeb3dd5c9e85d0c6df11173c9e5d702bdb
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 19, 2026.

Transparency log

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

Download URL arco-0.14.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
a5525da7b3bc05979520580969d142f2cf4158649880e379f029b563e870ac97
BLAKE2b-256 checksum
How to use checksums
33418cf2275a33ef8e751a35f2da2ffab18f2a6ea1c84512082756a0a9b831fd
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 19, 2026.

Transparency log

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

Download URL arco-0.14.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
362d14dc8c924dcea740504a992240e74cb053bde6ced6fddbee957e9f506c41
BLAKE2b-256 checksum
How to use checksums
b9d2cd9f156e58470ad597a6001a3818dfc04eb466baa0d0630112bc9e351c00
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 19, 2026.

Transparency log

Security for arco 0.14.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.14.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 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