Skip to main content

Python bindings for FICO Xpress Mosel

Project description

FICO® Xpress Mosel Python Interface

Run FICO Xpress Mosel optimization models directly from Python. Define your model in Mosel, solve it with the full power of the Xpress solver, and exchange data and results with Python objects:

from io import BytesIO, StringIO
import moselpy as mp

MODEL = """
model "production"
  uses "mmxprs"
  declarations
    PRODUCTS = {"Chairs", "Tables", "Desks"}
    Profit:      array(PRODUCTS) of real
    Capacity:    real
    produce:     array(PRODUCTS) of mpvar
    TotalProfit: real
  end-declarations
  initializations from "moselpy:" Profit Capacity end-initializations
  forall(p in PRODUCTS) produce(p) is_integer
  sum(p in PRODUCTS) produce(p) <= Capacity
  maximize(sum(p in PRODUCTS) Profit(p) * produce(p))
  TotalProfit := getobjval
  initializations to "moselpy:" TotalProfit end-initializations
end-model
"""

mp.symbols["src"] = StringIO(MODEL)
mp.symbols["bim"] = BytesIO()
mp.compile_model("moselpy:src", "moselpy:bim")
del mp.symbols["src"]

mp.symbols["bim"].seek(0)
model = mp.load_model("moselpy:bim")
del mp.symbols["bim"]

results = model.run(input_data={
    "Profit":   {"Chairs": 45, "Tables": 80, "Desks": 120},
    "Capacity": 10,
})
print("Total profit:", results["TotalProfit"])

With the moselpy module, one can control Mosel optimization models using the Python® programming language. The module allows for:

  • Compiling, loading, and running Mosel models (.mos source or .bim binary)
  • Passing input data from Python to Mosel and retrieving results, supporting scalars, arrays, sets, dicts, NumPy arrays, and Pandas DataFrames
  • Redirecting Mosel output streams to Python file-like objects
  • Introspecting model symbols and querying solution status

Installation

Install from PyPI:

pip install moselpy

A valid FICO Xpress installation with Mosel support is required at runtime. Set the XPRESSDIR environment variable to point to the Xpress installation directory before importing the module.

Licensing

The Xpress software is governed by the Xpress Shrinkwrap License Agreement. When downloading the package, you accept the license terms. A copy of the Xpress Shrinkwrap License is stored in the file LICENSE.txt in the dist-info directory of the moselpy module.

Miscellaneous

"Python" is a registered trademark of the Python Software Foundation. "FICO" is a registered trademark of Fair Isaac Corporation in the United States and may be a registered trademark of Fair Isaac Corporation in other countries. Other product and company names herein may be trademarks of their respective owners.

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 Distributions

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

moselpy-9.9.0-cp314-cp314-win_amd64.whl (113.5 kB view details)

Uploaded CPython 3.14Windows x86-64

moselpy-9.9.0-cp314-cp314-manylinux2014_aarch64.whl (164.4 kB view details)

Uploaded CPython 3.14

moselpy-9.9.0-cp314-cp314-manylinux1_x86_64.whl (174.5 kB view details)

Uploaded CPython 3.14

moselpy-9.9.0-cp314-cp314-macosx_11_0_arm64.whl (142.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

moselpy-9.9.0-cp313-cp313-win_amd64.whl (113.4 kB view details)

Uploaded CPython 3.13Windows x86-64

moselpy-9.9.0-cp313-cp313-manylinux2014_aarch64.whl (163.8 kB view details)

Uploaded CPython 3.13

moselpy-9.9.0-cp313-cp313-manylinux1_x86_64.whl (174.3 kB view details)

Uploaded CPython 3.13

moselpy-9.9.0-cp313-cp313-macosx_11_0_arm64.whl (142.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moselpy-9.9.0-cp312-cp312-win_amd64.whl (113.4 kB view details)

Uploaded CPython 3.12Windows x86-64

moselpy-9.9.0-cp312-cp312-manylinux2014_aarch64.whl (163.9 kB view details)

Uploaded CPython 3.12

moselpy-9.9.0-cp312-cp312-manylinux1_x86_64.whl (174.3 kB view details)

Uploaded CPython 3.12

moselpy-9.9.0-cp312-cp312-macosx_11_0_arm64.whl (142.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moselpy-9.9.0-cp311-cp311-win_amd64.whl (112.6 kB view details)

Uploaded CPython 3.11Windows x86-64

moselpy-9.9.0-cp311-cp311-manylinux2014_aarch64.whl (166.4 kB view details)

Uploaded CPython 3.11

moselpy-9.9.0-cp311-cp311-manylinux1_x86_64.whl (176.6 kB view details)

Uploaded CPython 3.11

moselpy-9.9.0-cp311-cp311-macosx_11_0_arm64.whl (142.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

moselpy-9.9.0-cp310-cp310-win_amd64.whl (112.4 kB view details)

Uploaded CPython 3.10Windows x86-64

moselpy-9.9.0-cp310-cp310-manylinux2014_aarch64.whl (166.0 kB view details)

Uploaded CPython 3.10

moselpy-9.9.0-cp310-cp310-manylinux1_x86_64.whl (176.1 kB view details)

Uploaded CPython 3.10

moselpy-9.9.0-cp310-cp310-macosx_11_0_arm64.whl (142.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file moselpy-9.9.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: moselpy-9.9.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 113.5 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for moselpy-9.9.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 deb34d29092000070aec6f3648a5434ebb16d40ae8ef03dd61b0a15098cca08d
MD5 5acde9b1a9c71d412a752cb19097b446
BLAKE2b-256 cd3115d58d6e3411537f95c84e8dc448e9f875bc42591d3fdb0e97dc9b0c8db1

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp314-cp314-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 abfa89a0f19347f95562142ee9a7ad1275dcc5656489392e2148b33e61a05827
MD5 c609578054c3717ed4fabe50a85e0f75
BLAKE2b-256 5cc8b46198db6d3d7520592135378bb65c226ea42eb77d332e47284e0b7f0df5

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp314-cp314-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp314-cp314-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 72b891d859cbbb367af34a8d80d1ac7c3e08859ab6f1d354d393cc6147092cf8
MD5 d89289f458bacc4b3389a7423ae17e46
BLAKE2b-256 11ba08198c8464fe9e64db168f0114ed195a5187165a6f8b7ad142929196c08f

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1fb00a9d6413e3656b4a870b6288e764ed9c67a400e5e3c6d34a446bb5b71999
MD5 0e5bf76a7568048fd13e1c046b363718
BLAKE2b-256 c57dc5844be882d667123c4db6496899a6bbae8ec7d003354edbce2ae52bb253

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: moselpy-9.9.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 113.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for moselpy-9.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe31ee79262290cf6c442a908a5650b4a9644dfd88095bd324aa145db1dbd901
MD5 440c26c7c870de3fa70a7f5c77a767cf
BLAKE2b-256 5338b6ead29956d65ed21fc4b9da21ecdbb3aab320680bb6105ce34d0e7a29a5

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c405709c6e9d0aa095a4868d0ea5d2e4b2b0cff830eaec825518a5c0a86920c6
MD5 646e913445d27dd32a70519e05789bde
BLAKE2b-256 a3827ed68af077c64bd9d93264039670d22e7a209602a692d7146e4c0f6451cd

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 494f8c41ca42ea7f28bef602912ba0b3449d9410a5f1ce6aeec6328009dfe0d6
MD5 73aa327d8a62e7b6c9bdb4fad17b30b6
BLAKE2b-256 37050259ae4683f5be8bedf176545892d02714aab8e1ec7f63b81d3498ba9f03

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66acd62ea4f69b05c7c7fecb3e4d8cd907bac07b5d664657b442271dd8e71943
MD5 d35fba152395e01c2f3d2887eac9190a
BLAKE2b-256 22393bef8c80019b8e096d2bfc60756e84f500343c5cef2117f532776677c85f

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: moselpy-9.9.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 113.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for moselpy-9.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7d8644b8dabb3d3c9c497d71db629b1df94d5515f01fb27dde214e6a40516454
MD5 939abce0eb3d4838a1bc5c9f0afcd2cb
BLAKE2b-256 9482733e2e3c48d8aad1d07536bc5a6df2833fc68b5665446095816d5c884d7c

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f38614243c469248ae2e85aa367ad7645ca94de77cd820e57937d842053a13a1
MD5 6505fa20b05f114c168f04b7c91af7b7
BLAKE2b-256 0374280fecad8ed6618f5041ca03cfde145ece565d1cceae2eb8cc277b1b7e94

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c4817e226e28acea352552e9ded515aac6ceceae29cab6e7f8e4320f3eec83f3
MD5 6c44b3fa5da31a4732953fed86ab92c1
BLAKE2b-256 fe29614acad1ca7409f4b621a69b61084843a2ec58537ca8b2dc4e09758b21e8

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33a2c598b52d17a202741e14f130fb0bcab968554d65bb0613bc48e69b7b698d
MD5 1a36a494ad6320923f2494a6fdaaaa94
BLAKE2b-256 8ca8520a602bdef71740b76b0a850105fff9f43620784e1676857a2cdff18863

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: moselpy-9.9.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 112.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for moselpy-9.9.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 34734c454482679ddf17a932ea995d6903c1e61a74f3ab2754b52ca6a1397dfd
MD5 75e4e72000a6ae103ddf51904d36c89d
BLAKE2b-256 85cf1826dab0641ef5a5519d2201dc11b8db29059cfa6441ca71d751de14ebae

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2e9914db2847ea33bfb5121162310bec278a725da9e2e0d52c0926789a120d7d
MD5 6432a495078fc5e194cf4f5ecd23f0bd
BLAKE2b-256 2de10a0dc25dbaf86d2a5e8e1349972a79ba1c504d39ed0626e28e4634bb688e

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a891b715a2e47a4c064e8ab8af10e87d4048dd51cddae8b74774b472570b81aa
MD5 8ad397f38c09c5c8c6f7ae2e2319fbdf
BLAKE2b-256 f5b23cb140615af7d2665993139667f236f5d8b81a859a004dff294acd3cdd23

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38c76f8f03137f3b8f01a33683e789d73a2c120134528d89bf2fcac16b427ab9
MD5 47394531adcfff87701992907c681a74
BLAKE2b-256 ccc4fca95c91f385bd74210bc067ca2e93587c2dac055729cd5156fd66fe1e12

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: moselpy-9.9.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 112.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for moselpy-9.9.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 128015378c62fae5e69ec46dbd0537a57248c1818c3597cdc4653da8160c5b1d
MD5 bae703717d22387fa4d16168e8704855
BLAKE2b-256 6fa6d1480356c135fc065340b6c9890ce1898da15ebefdd4113f0cee674b4e74

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3a7d17b4604f4f62cf08aab2c68d9c404b510c323b993c875d740673939e48d7
MD5 8adf11d2daf6a8d266c067b5c8d62e48
BLAKE2b-256 adcb6564f9bb91129131c3b9b1531a2249a7e496286d8bc68eb9082832cf1060

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 95156c453c8be686bf13e927229c677416e0f8db0237358f9a27c4dd0806c832
MD5 5ac7c8f1bc18149fe0e4f183d806d648
BLAKE2b-256 406363025f54357871ed1d84520d88135dce5953df3208a71b772b1d21488996

See more details on using hashes here.

File details

Details for the file moselpy-9.9.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moselpy-9.9.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca6ab352be17a22f91b4f0fa12379b30e44f68b5b655897b2b994a9531103b5a
MD5 1e106634c38cb2d1791bc19ef25e76f5
BLAKE2b-256 98b582b3276d7a23c90bf002d2a618f9657b7b10b989012dbd2f463df17aa051

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