Skip to main content

Python bindings for Arco optimization library

Project description

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 is unchanged.

Build and install locally with uv:

cd bindings/python
uv sync --group dev
uv run --with maturin maturin develop

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

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 Xpress for a source build, turn off default Cargo features:

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

Without this feature, arco.Xpress(...) is importable but solve will fail fast with a rebuild hint.

Run linting:

uv run ruff check .
uv run ty check .

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.

Project details


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.8.0.tar.gz (417.4 kB view details)

Uploaded Source

Built Distributions

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

arco-0.8.0-cp311-abi3-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

arco-0.8.0-cp311-abi3-manylinux_2_38_x86_64.whl (8.8 MB view details)

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

arco-0.8.0-cp311-abi3-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

arco-0.8.0-cp310-cp310-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.10Windows x86-64

arco-0.8.0-cp310-cp310-manylinux_2_38_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.38+ x86-64

arco-0.8.0-cp310-cp310-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for arco-0.8.0.tar.gz
Algorithm Hash digest
SHA256 ea084ad69aa2de8d382f3fcabad0cc70951f6e094420f2e347150352ff5ea1d9
MD5 31ecf1cb42c4f542eb613e3066626650
BLAKE2b-256 7d6fd8c9ada5b9dacf8b3537092f9971a25edb10a81e8c40a132263df1999cda

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: arco-0.8.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.8.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 261ebd58dddf6b012478a9d00f587f4dadab2318a5d51a12d4953f9ee48a24e6
MD5 96bfe2668b75093320bcd3094e5d68c4
BLAKE2b-256 4f4b3e532d7e99c1673dfbaf739eb9669e3820a2c78044cc2e675d00d34cda6e

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp311-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.8.0-cp311-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 d6a205781adeee9115ab88130592054a4fec01ff79e0f54899ee5071887d7a2a
MD5 b9e7e90d3aebec5a1e237e2e5ff3cdbd
BLAKE2b-256 52a831775a90fb70073d5f572416e46f7f72b023de274794b03e7ca350c76b9b

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: arco-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for arco-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6489ff6a270a7e36434c3ec2fd5123a6bd67477dba171d0844bd6be5d952e9e8
MD5 bda3e83d9d3577129c8f4dd8daba0a63
BLAKE2b-256 3d37bf8d5d38224f2865fa5a366f7e6abba569f8a892a8b996c649874ab6a09c

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: arco-0.8.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7dde5c06a8e34173606d8544f2d5eebf0a87745fd1140648b2521426994ab3da
MD5 5a96b7f731fa77cbbbc275764acc4f85
BLAKE2b-256 4d7cef10323d5b70e35cb1fa4a1d70054261a0ad021b50d7b475669027ae98d4

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp310-cp310-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for arco-0.8.0-cp310-cp310-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 eda48ec77cee378a28d19ede3cf41080101fb4f547b8eae6712d41d495dd13a9
MD5 4f05408ee1676c8198c40557bc32a1b4
BLAKE2b-256 c128d01ff550ccec29c9acc4df1b29b562b98c77cf45ae09b4916507bddf78ec

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.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.8.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arco-0.8.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50deb5bf4cf67d72d3857ff41fa4e797aaf0b33ccdacdc7952b96cd73724d887
MD5 2ff21500c37b0257b98b0c0444873441
BLAKE2b-256 481d100ba7112df27caca1a8b5b3eeedcee8149a2d785deae4a74258b3d387a0

See more details on using hashes here.

Provenance

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

Publisher: pypi-manual-release.yaml on NatLabRockies/arco

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page