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.
Metadata
Release files for aimmspy 26.1.8.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 6.7 MB
Release files / aimmspy-26.1.8.3-cp314-cp314-win_amd64.whl
| Download URL | aimmspy-26.1.8.3-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 812.1 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ef9c55c5fef25136f907681188cabefd70eaa8ea15300412138220507a693845
|
|
BLAKE2b-256 checksum How to use checksums |
fefbf0b5b84a62e1a9739946f145221d78e7edaa7011d71bf0fb8a0d84f19a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp314-cp314-manylinux_2_27_x86_64.whl
| Download URL | aimmspy-26.1.8.3-cp314-cp314-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 542.9 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
b1a23b028f4c34329a083499ae6aa1c914ca5b770ee160371da0388a74708f78
|
|
BLAKE2b-256 checksum How to use checksums |
6fc2c110bcd9d1b286612d873ce0ae1cfdc951e66f78b0b1193ee55b6b58556d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp313-cp313-win_amd64.whl
| Download URL | aimmspy-26.1.8.3-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 784.7 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ecbe88b4661cbcedf3f7030a9555eb8c725694c8de605edcd911a4b2b5eedb0a
|
|
BLAKE2b-256 checksum How to use checksums |
46574ae6a8fb5fc4a0c24667a1c155a048d4cd264a49018861b175e0900e9cda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp313-cp313-manylinux_2_27_x86_64.whl
| Download URL | aimmspy-26.1.8.3-cp313-cp313-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 542.4 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
9ad12fb2d8a8cda0d2d4bf6e48bac89a97de814cbee728a62ab34e48ffe96b5f
|
|
BLAKE2b-256 checksum How to use checksums |
29360d4982f67cb6a25ab2ed361a51e7ae450b8546920b11fa5c9c9eb6bbff00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp312-cp312-win_amd64.whl
| Download URL | aimmspy-26.1.8.3-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 784.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5b56553c310f633c7e59ca0cbb261ebc12ae0ee3b898aebcd4fb894eeb04c73f
|
|
BLAKE2b-256 checksum How to use checksums |
1cb8031d4d9f5776789ff265d76e9e569bc7f4a6590e6b84e54a50fb5c484dcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp312-cp312-manylinux_2_27_x86_64.whl
| Download URL | aimmspy-26.1.8.3-cp312-cp312-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 542.3 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
5e5b11d6652c3e3605480f1dcc263cff7926ca4268e4078ebe8bd41e6d20de72
|
|
BLAKE2b-256 checksum How to use checksums |
79745b022e5d61962c3a3d99f9a48d24c90353101da6827940b0c7e13a6081e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp311-cp311-win_amd64.whl
| Download URL | aimmspy-26.1.8.3-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 787.9 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a0b62a5356a1133f0bb618c635529b257b27804ea861b16768f36e68047ec116
|
|
BLAKE2b-256 checksum How to use checksums |
435e9f64befdc11682be3944d5316d05243288d624be9514052b9dab8b6bc46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp311-cp311-manylinux_2_27_x86_64.whl
| Download URL | aimmspy-26.1.8.3-cp311-cp311-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 541.6 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
da1e1314b7be760c91d219620506669001811bb9e19db839b39d7c40ea5197b5
|
|
BLAKE2b-256 checksum How to use checksums |
766b9e4071fdacc1e486dbd7b156779f74ab5a94077f92f54f71439fec2c327a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp310-cp310-win_amd64.whl
| Download URL | aimmspy-26.1.8.3-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 787.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
08a1020c3d8fb1a738f6951660e42503b8c145b610a0e1bdeed6581e55e5547e
|
|
BLAKE2b-256 checksum How to use checksums |
a8d244f176ae2aebf59c941acffcc3c7bb12bd23cef3e442b5c4e7e5e0987864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / aimmspy-26.1.8.3-cp310-cp310-manylinux_2_27_x86_64.whl
| Download URL | aimmspy-26.1.8.3-cp310-cp310-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 541.2 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
1bb1d7166a0218b4e19ec8a3119139810c8fc5566569b3b3878b9f75074d61de
|
|
BLAKE2b-256 checksum How to use checksums |
926557732469fe83c2e5a093771b7dbdce0843f8970de99f1e9fc171a4f04d25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|