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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arco-0.11.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

arco-0.11.0-cp311-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.11+Windows x86-64

arco-0.11.0-cp311-abi3-manylinux_2_38_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.38+ x86-64

arco-0.11.0-cp311-abi3-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

arco-0.11.0-cp310-cp310-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.10Windows x86-64

arco-0.11.0-cp310-cp310-manylinux_2_38_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.38+ x86-64

arco-0.11.0-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file arco-0.11.0.tar.gz.

File metadata

  • Download URL: arco-0.11.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.11.0.tar.gz
Algorithm Hash digest
SHA256 8fd36f1e0c620a2409b964fc72b0dee7c13510bed1ea172cb59ec967ad13e24b
MD5 eb0cb18bece5a3d4a35f208949e2006c
BLAKE2b-256 93516d3580895ab57a9d96a11106289c26b81161fe5c684cfb5d6f9865e195bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0.tar.gz:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: arco-0.11.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.11.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 89219601ca04608536b58ed31709c8b2cd80d4521f19a379f8c5347f1342f7ab
MD5 d56463a90e63a4c6716c67e076f66c99
BLAKE2b-256 b1f86f859929238f9381ed9f3ff112ebd99652d47dbe4484423b883bf3dd25fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp311-abi3-win_amd64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp311-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.11.0-cp311-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 23275d7124525cf74cd9f089aae174e8052b38138daa03775768e68c56e575db
MD5 9ad69e051d92f5e8891c30ab05a0a9dc
BLAKE2b-256 7960b5ee71fa0cc47351a6d91a028d3df4656dffc318aa88b87f71dfe04a9e1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp311-abi3-manylinux_2_38_x86_64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arco-0.11.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a69c58048386b7c65288083eab48db1cb4ff2bbdfbdfb43b14b7c8544465ede
MD5 3ca4f6e6875995fc4a38bb8b23fa9efe
BLAKE2b-256 bb2db26a9481aa4a7be9141e19da0d12d6c6500369f15d3ee6ad71b758269a9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: arco-0.11.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.11.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 73e2196a08902eeb8eea3260e510b0b7cd0e28710f1a9c2df9aceecf6f3ee9a3
MD5 2e3da82caef3f06b507b55282be92a45
BLAKE2b-256 e40db6ed5e9d641b6457154ef9aaf7a5d2d6d28c5c986e819463cfd09ff5d59c

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp310-cp310-win_amd64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp310-cp310-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.11.0-cp310-cp310-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 60d7ef01363eb2b9f8dc855d509b5ad1e12e529f732ed4874eac369c88565ecc
MD5 e57ed7820356ca0d045684382666d27b
BLAKE2b-256 cedc86bda3b3ea4a9739ec76473dd32c813c1555a6c9138693ed4cc5d3705b81

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp310-cp310-manylinux_2_38_x86_64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arco-0.11.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arco-0.11.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8efa039fa149c2aea01960089b5df6205dd636f8be730da020d7d9c350622c0
MD5 4deb7ba19e7a42bdbcd321d2b1622bfb
BLAKE2b-256 a8c3cdd2cfe2407d03bc9dec3243bde40c4be0f67809e6d1b36f1f19278408d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for arco-0.11.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release-please.yaml on NatLabRockies/arco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.11.0 This release

7 files

0.10.0

7 files

0.9.0

7 files

0.8.2

7 files

0.8.0

7 files

0.7.0

10 files

0.6.1

3 files

0.6.0

1 file

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.8

2 files

0.2.5

2 files

0.2.1

15 files

0.2.0

15 files

0.1.6

15 files

0.1.5

15 files

0.1.4

10 files

0.1.3

10 files

0.1.2

10 files

0.1.1

11 files

0.1.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