Skip to main content

Official AIMMS Python library to work with the AIMMS cloud environment

Project description

aimmscloud

The aimmscloud Python library is a lightweight library to make calls to the AIMMS Cloud rest API. You can use this library to publish AIMMS applications and execute tasks.

Getting Started

Run the following command to install the aimmscloud library:

pip install aimmscloud

After installation you first need to provide a HOST_URL and an API_KEY before you can make any calls.

from aimmscloud.aimms_application import Application

app_api = Application(
    host_url="https://<accountname>.aimms.cloud/pro-api/v2",
    api_key="<API_KEY>",
)

Publish an app

You can publish an app by building an AIMMSpack using the AIMMS IDE. When publishing an app you need to provide metadata such as the applicationname and version.

app_api.publish_app(
    file_name="example.aimmspack",
    iconfile_name="icon.png",
    aimms_version="<aimms version to use>",
    application_description="<app description>",
    application_name="<app name>",
    application_version="<app version>",
    attributes={
        "isWebUI": "true",
        "ServerLicense": "Default",
    },
    projectCategory="<app category>",
    publish_behavior=0,
)

Create and run a task

When you app is published you can run tasks with the create_task call. Note tasks are only available if you registered a task as an service in DEX. The payload variable is optional and only needs to be used when your task expects an input. Inputs are passed as an Python dictionary.

task_api = Task(
    host_url="https://<accountname>.aimms.cloud/pro-api/v2",
    api_key="<API_KEY>",
)

out = task_api.create_task(
    app_name="<app name>",
    app_version="<app version>",
    service_name="<DEX service name>",
    payload=payload,
)

If your task has a response, for example the result data of the optimization such as a schedule, you can retrieve this with the following call once the task is complete.

out = task_api.get_task_response(task_id=task_id)

Experimental feature: Command Line Interface

We are working on adding a command line interface to AIMMScloud. There is an experimental version available for the application api.

pip install aimmscloud[cli]

Further development

This project is under active development by AIMMS bv.

Project details


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 Distribution

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

AIMMScloud-0.1.2.2-py3-none-any.whl (136.6 kB view details)

Uploaded Python 3

File details

Details for the file AIMMScloud-0.1.2.2-py3-none-any.whl.

File metadata

  • Download URL: AIMMScloud-0.1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 136.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.0

File hashes

Hashes for AIMMScloud-0.1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55902eb92b3b1c2d2748f655e2c8d3d651d950536c056225ea8b536958d6806f
MD5 debfef727aa1047a1dceba5b054d9162
BLAKE2b-256 2367fbb48980e8af167a740e16bf3c86c0e6124019d1a9492678014d85df6953

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