Skip to main content

Python bindings for the AIMMS optimization platform, built with pybind11 for seamless C++ integration. Enables efficient data exchange and interaction with AIMMS projects using pandas, polars, and pyarrow. Ideal for advanced optimization workflows requiring high-performance native code.

Project description

AIMMS Python Library

With this library it is possible to interact with AIMMS models from Python, enabling high-performance, headless interaction with AIMMS models from within Python scripts.


Overview

aimmspy is a Python module built on pybind11 for tight C++ integration, enabling efficient interaction with AIMMS models. With aimmspy, you can:

  • Assign and retrieve data between Python and AIMMS using Python dictionaries, Pandas, Polars, or Arrow data frames
  • Execute AIMMS procedures (such as solves) programmatically and capture the results
  • Benefit from high-performance native code, ideal for advanced optimization workflows

aimmspy is a key component of the AIMMS Python Bridge, designed for "Python-in-the-lead" scenarios, where Python scripts drive AIMMS model runs. It complements the pyaimms library (accessible from within an AIMMS project), which supports the reverse ("AIMMS-in-the-lead") workflow.


Key Features

Feature Description
High-performance integration aimmspy uses pybind11 for efficient C++ access to AIMMS runtime
Flexible data exchange Leverage Python-native data structures-dictionaries, Pandas, Polars, PyArrow, for data handling between Python and AIMMS
Programmatic control Trigger AIMMS procedures (e.g. solve) directly from Python and retrieve results
Python-first workflow Ideal for batch runs, automated pipelines, and embedding optimization in external applications
Bulk data handling The multi_assign() and multi_data() methods allows sending and fetching multiple AIMMS identifiers in a single call

Prerequisites

  • AIMMS Developer installed - the low-code optimization modeling platform that provides:
    • A full-featured IDE with a rich mathematical modeling language for formulating LP, MIP, NLP, MINLP, stochastic, and robust optimization models
    • Access to high-performance solvers (e.g., CPLEX, Gurobi, BARON, CBC, IPOPT, KNITRO, CP Optimizer)
    • An integrated WebUI builder, model explorer, and deployment tools
    • Fast deployment and decision-support app creation
  • A valid AIMMS Developer license and an existing AIMMS project to connect with (project file, executable, license URL)
    • You will receive a license URL in the installation instructions after verification, this URL will be needed when initializing a connection to the AIMMS project

More information on how to get started can be found in the python bridge documentation.

Note: AIMMS offers a free Academic License for students, educators, and researchers. This makes it easy for academic users to experiment with AIMMS and aimmspy without cost.


Installation

Install via pip:

pip install aimmspy

Basic Usage Example

Here is a minimal example showing how to connect to an AIMMS project, assign data, run a solve procedure, and retrieve results:

from aimmspy.project.project import Project, Model
from aimmspy.utils import find_aimms_path

# Initialize connection to AIMMS project
project = Project(
    # path to the AIMMS bin folder (or Lib on Linux)
    aimms_path=find_aimms_path("25.5.4.3"),
    # path to AIMMS project
    aimms_project_file="path/to/your/project.aimms",
    # license url
    license_url="wss://licensing.aimms.cloud/your-license-url"
)

# Get a handle to the AIMMS model
model: Model = project.get_model(__file__)

# Assign supply and demand data to the identifiers in the AIMMS model
model.Supply.assign({"Factory1": 35, "Factory2": 50})
model.Demand.assign({"Market1": 45, "Market2": 40})

# Assign transportation costs
model.TransportCost.assign({
    ("Factory1", "Market1"): 10,
    ("Factory1", "Market2"): 15,
    ("Factory2", "Market1"): 20,
    ("Factory2", "Market2"): 5,
})

# Run the optimization procedure defined in AIMMS
model.TransportSolve()

# Retrieve results: optimal shipment quantities
shipments = model.Shipments.data()
print("Optimal shipments:")
print(shipments)

This example assumes you have an AIMMS project with identifiers Supply, Demand, TransportCost, Shipments, and a procedure TransportSolve set up. Replace with identifiers from your own AIMMS project.

License

This project is licensed under the MIT License.

Support

For questions, bug reports, or feature requests, please contact AIMMS B.V. via support. Or post an question on the AIMMS Community. We are happy to help you with any issues or questions you may have.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

aimmspy-26.1.4.2-cp314-cp314-win_amd64.whl (806.3 kB view details)

Uploaded CPython 3.14Windows x86-64

aimmspy-26.1.4.2-cp314-cp314-manylinux_2_27_x86_64.whl (878.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64

aimmspy-26.1.4.2-cp313-cp313-win_amd64.whl (777.5 kB view details)

Uploaded CPython 3.13Windows x86-64

aimmspy-26.1.4.2-cp313-cp313-manylinux_2_27_x86_64.whl (878.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64

aimmspy-26.1.4.2-cp312-cp312-win_amd64.whl (777.5 kB view details)

Uploaded CPython 3.12Windows x86-64

aimmspy-26.1.4.2-cp312-cp312-manylinux_2_27_x86_64.whl (878.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64

aimmspy-26.1.4.2-cp311-cp311-win_amd64.whl (785.3 kB view details)

Uploaded CPython 3.11Windows x86-64

aimmspy-26.1.4.2-cp311-cp311-manylinux_2_27_x86_64.whl (877.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64

aimmspy-26.1.4.2-cp310-cp310-win_amd64.whl (784.4 kB view details)

Uploaded CPython 3.10Windows x86-64

aimmspy-26.1.4.2-cp310-cp310-manylinux_2_27_x86_64.whl (876.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64

File details

Details for the file aimmspy-26.1.4.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aimmspy-26.1.4.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 806.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for aimmspy-26.1.4.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 68455ae6424e57cef51d37e882bcacb586a030c11e76f4b6963e07cae4e6c9b5
MD5 f999709bd5150e571e916c4c9361981a
BLAKE2b-256 ffb2c3142abf756501e733675bbbb16e9b5daf4f0c04b245a8866031ae352ea7

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp314-cp314-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for aimmspy-26.1.4.2-cp314-cp314-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 94f4acce9809e20195f690871eeece06fe641e2b94e68cc6addb9f476739a639
MD5 f7747511c009750a5e1a9f2b401e0f1e
BLAKE2b-256 cc84dd8b7e279c1612fef118b207eedaa13d78982083ecaf9489b992017221cf

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: aimmspy-26.1.4.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 777.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for aimmspy-26.1.4.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f4aea8eb1c7d6e4d6c5bc91c911e9be28154167bb051a4e2d7cff771210e1411
MD5 d641dc6d8c477b753a63d2bf095cdee5
BLAKE2b-256 75ca8f8a3671a032e2f74733c0719ee96ff2ec66fc8b12b559aeb2770b425fa1

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp313-cp313-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for aimmspy-26.1.4.2-cp313-cp313-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 cd14ae55c915dccbc327a38933543f498aed830eb4bdfb7367ccfa177da81ff2
MD5 39044d5fe805c3a64d1b55e5310de2c1
BLAKE2b-256 663501dd928322678593dfd3a7748f4b3382072b1cd2fd1a9e61b8ce3ee3af27

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: aimmspy-26.1.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 777.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for aimmspy-26.1.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 be494bb742e7ae6feb8fcb7a1232925fd17f384589b3f690ecb1e29a7d88073e
MD5 1556ac085e69fcb16f8e09de13f5e402
BLAKE2b-256 64ca52ee726dcf326e6f992df1783c224c1b32efe260670addbc185f12ca06f3

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp312-cp312-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for aimmspy-26.1.4.2-cp312-cp312-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 b1ffc1a85528d2588c5e5e400dfb353f2db16d642bb16d161e83b67dc580dbc7
MD5 a5db07480d52ee77bf07ae0e8c8a45a3
BLAKE2b-256 611a334446114f31c83f5f7998b9f2a2d2095abd5a8e89409dcb4bb9a25dead3

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: aimmspy-26.1.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 785.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for aimmspy-26.1.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 37e1da9a03cd02a53d7195e43e73a64740abd727f91a09ad1585cba443903110
MD5 aa21034d3989db2f96a15019dffaa740
BLAKE2b-256 74f5451de919c516ff32306ac8f8c562c5bd9ab58f9a43c23772cdb64197a196

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp311-cp311-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for aimmspy-26.1.4.2-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 85f4c75a5da6c56386091fce6c5ab4351a5ed8b2b0187584a4ce35d96f5e3e85
MD5 c0b2440d7a15c1fb8dac8d891cbfc334
BLAKE2b-256 7d1a101e0b0c102a2e5d86f13f079874d2d942841eba67d51ed18b36d3ec1ab0

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: aimmspy-26.1.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 784.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for aimmspy-26.1.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 34b239b966c4bf3cd7625afb8c97e1a300ff5c5376d74490a6afd00ae776fbb5
MD5 ce1efc0fd885938f922d0146efad6083
BLAKE2b-256 8d196ecb6a541db6d65189d28372ce8fcdcbc3163ba9a91ba9f0e482213133a5

See more details on using hashes here.

File details

Details for the file aimmspy-26.1.4.2-cp310-cp310-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for aimmspy-26.1.4.2-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 14c1150759f78e89f69d91015262ced76b403097f3a640335742eb1d224eb610
MD5 8355784eece13d2de35c9c9bf6e01ecd
BLAKE2b-256 e77ff27eedb6d04a0f1cc6193d5f067f318e3bd83670b6a82ef0e4c3405d2053

See more details on using hashes here.

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