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.12.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.12.0
File Size Uploaded Provenance
arco-0.12.0.tar.gz 2.4 MB With provenance Details

Built distributions (wheels)

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

Download URL arco-0.12.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8a83c8dd6d4f38a72aec0d8627d2538a9972f9993b257f4864e2d0165fc3a6cd
BLAKE2b-256 checksum
How to use checksums
8baf08bbb123be6e58d0f019b53fe2c3c5f6cc912a279de2c44067ff94fc1768
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 7, 2026.

Transparency log

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

Download URL arco-0.12.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
9ef30c89ddb1b4fb0ceeab39c333cd5a67512c8ad43aac3817f9b3a3d3a84bf8
BLAKE2b-256 checksum
How to use checksums
3bda6c95a70ba66a4517de6217a47cc18ac9698b634d3565d830863b0b9d7e7b
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 7, 2026.

Transparency log

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

Download URL arco-0.12.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
a95f94a71cdf3be5a9d05848bfb7a8b169791bb545969a64f5e95318405e7b17
BLAKE2b-256 checksum
How to use checksums
6a358a13dd90a9f387f98ab9dbbce95c1a82be978e317ddb0eb40a0f798696d4
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 7, 2026.

Transparency log

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

Download URL arco-0.12.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
51d8885fe1eebbf543e2bd5505fac10e497d9ac53fdcc599d6fff31315417ce6
BLAKE2b-256 checksum
How to use checksums
2b372713b08c51c984873f5ac0ac6ef012d7f32393f78943fde43e3f16ca3525
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 7, 2026.

Transparency log

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

Download URL arco-0.12.0-cp310-cp310-win_amd64.whl
Size 3.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
346adcdf207f0a242b703defc977ac96243d05a7c0cfe1eb1dc0133be73b3b56
BLAKE2b-256 checksum
How to use checksums
88c133b7143f206c201db52bac11fba32bbac58c9bf7cdf04459c593a02360e0
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 7, 2026.

Transparency log

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

Download URL arco-0.12.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
118d6483a7f9cda0aa05f540a09ce330f6f67beaafebb28cedec22a90984d4fd
BLAKE2b-256 checksum
How to use checksums
6ee975a891541afb7d97b4d1e21bfdec0c5c601e5d453c67432255cd160633b5
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 7, 2026.

Transparency log

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

Download URL arco-0.12.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
3ebf8e5aa940530f228da5ac9cf18a9d0eb140f89c9ae9b9c83cc626e837f378
BLAKE2b-256 checksum
How to use checksums
5c79e1820d641d64be1020e4eeef91ffc8a2d3f07fd262ad0c6865b2f01ce69a
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 7, 2026.

Transparency log

Security for arco 0.12.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.12.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 7, 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