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 (
.mossource or.bimbinary) - 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.
Metadata
Release files for moselpy 9.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 3.0 MB
Release files / moselpy-9.9.1-cp314-cp314-win_amd64.whl
| Download URL | moselpy-9.9.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 113.5 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
24596ac97b519466824c9b7e9b7ace93eb47a65e57677fe3e7382458c8495bce
|
|
BLAKE2b-256 checksum How to use checksums |
40f528b9be841255a13de8c43611302aa19b02cbfb224e6ba75d7e901a361ce2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp314-cp314-manylinux2014_aarch64.whl
| Download URL | moselpy-9.9.1-cp314-cp314-manylinux2014_aarch64.whl |
|---|---|
| Size | 164.4 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
8bd2d0db16cd9da6a938985154c8888104b377e4fc6c8fa060727b2887246f90
|
|
BLAKE2b-256 checksum How to use checksums |
545f9f2fde09c80f59639ecd013b2cb6c43eccd6b13570ae11958c50a2202688
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp314-cp314-manylinux1_x86_64.whl
| Download URL | moselpy-9.9.1-cp314-cp314-manylinux1_x86_64.whl |
|---|---|
| Size | 174.5 kB |
| Tags | CPython 3.14 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8411b97050d2aee981a7aa0f0e6ced52c924c54f1b894461a5e98e1622327adf
|
|
BLAKE2b-256 checksum How to use checksums |
5860d052c60c1c5ed637734fd6ed1bbdcb2f257011d9d2cde93508f3f6068dcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | moselpy-9.9.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 142.8 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8791a47d5f700fe292a1fea572221c226db954db936b8ec119d94987fd8d658e
|
|
BLAKE2b-256 checksum How to use checksums |
62f949c65592a82ce584678face63438f5b699b16b087bb98fb27911a9c53f1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp313-cp313-win_amd64.whl
| Download URL | moselpy-9.9.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 113.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c960f4567158d3cf1146eabc1a2f49170db466fd66ff7f40862ae9e33e07ef7b
|
|
BLAKE2b-256 checksum How to use checksums |
2dd10961ecdff6630ff9c3738648f351762bb94981e3837d83abcb9fdee9fd2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp313-cp313-manylinux2014_aarch64.whl
| Download URL | moselpy-9.9.1-cp313-cp313-manylinux2014_aarch64.whl |
|---|---|
| Size | 163.8 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
3b8d2c32a343b8cfbef771b387b52d510845ec79b12f99aa8a00b3e23336f79a
|
|
BLAKE2b-256 checksum How to use checksums |
28b00784f33cdd2e86270e00a44bb31bed67d8dc4052f0b001f536dd30b5c294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp313-cp313-manylinux1_x86_64.whl
| Download URL | moselpy-9.9.1-cp313-cp313-manylinux1_x86_64.whl |
|---|---|
| Size | 174.3 kB |
| Tags | CPython 3.13 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
4edc774e7059f7b2acdbb2b0f98929e696ddb35d3216051f943da3dd7b13c8db
|
|
BLAKE2b-256 checksum How to use checksums |
81a9dcd73d6660ee156998f29b23bb5a10618296f99261814c60fc64e3f12a54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | moselpy-9.9.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 142.6 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1d0c0724b9125d7ea563a43d19a0a9d07b86b9f1bb7d3a6d2f6769bb52a46b45
|
|
BLAKE2b-256 checksum How to use checksums |
a449aa04a309e7d29308abd87856b69ef862c8fcf7d5a050dc5193d1e94de0c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp312-cp312-win_amd64.whl
| Download URL | moselpy-9.9.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 113.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
839d088952723579226d0268cc216e7911696b5e6b65116bb8f2721678166018
|
|
BLAKE2b-256 checksum How to use checksums |
13fd2494132cb92f2eb688960f5beea01f5361630db3a0e6ca4baad79f3ef884
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp312-cp312-manylinux2014_aarch64.whl
| Download URL | moselpy-9.9.1-cp312-cp312-manylinux2014_aarch64.whl |
|---|---|
| Size | 163.9 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
10ac6b31748b52071e3f8728d6e85867b053f9c1d7ede62c12af6674899acd0b
|
|
BLAKE2b-256 checksum How to use checksums |
e73f1bc2c4a962dbf8a6b8dd605a924ddbba552054eba2b4ffec4ae6a610360e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp312-cp312-manylinux1_x86_64.whl
| Download URL | moselpy-9.9.1-cp312-cp312-manylinux1_x86_64.whl |
|---|---|
| Size | 174.3 kB |
| Tags | CPython 3.12 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5259c1b5acf98271cdb01a1061390dc3c2c5acf78856c61db6818a87ace416c4
|
|
BLAKE2b-256 checksum How to use checksums |
7fbe3614caee9f2e3bda04667dea957a0b66ed889a3544ed9bf001fd45bbaa5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | moselpy-9.9.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 142.4 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
46e1d8ee1dff67876e1848b6f39024fc562bd75321986fcf8cd536df1cfe8be3
|
|
BLAKE2b-256 checksum How to use checksums |
c7e32be49704a0fa0f58b5a31d2720d806dc1302855bf1a09cc27d0cfcabfbc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp311-cp311-win_amd64.whl
| Download URL | moselpy-9.9.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 112.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
44c800cb17975a479164c4652e0b5625352c2fc07c38f0f3beb42cb01e63746f
|
|
BLAKE2b-256 checksum How to use checksums |
5af9fb3db1eddee988881b846829e28dcbf6e45f5616824b41bd355f7c8d358f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | moselpy-9.9.1-cp311-cp311-manylinux2014_aarch64.whl |
|---|---|
| Size | 166.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
9c32889df4bf9e0ea9b7a9f357b46a399b9a4736e733885b6efa4044b3ff5f41
|
|
BLAKE2b-256 checksum How to use checksums |
a656fb9f735f0135d68fef973ef6082bd6c14f56359b0dc1903ead2dc5419417
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp311-cp311-manylinux1_x86_64.whl
| Download URL | moselpy-9.9.1-cp311-cp311-manylinux1_x86_64.whl |
|---|---|
| Size | 176.6 kB |
| Tags | CPython 3.11 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
7566ae59f194714f1545d8ad73c39438d95142fc907e0779a5c610cf14c20d8a
|
|
BLAKE2b-256 checksum How to use checksums |
c156e08d4c9cfd9646201845b3c6a945f6fc36de3cd19e75a3265590d1b6a92f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | moselpy-9.9.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 142.4 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aaa0cfdb822859b3289006ab578a33e99e9ffa960e487296bf9f5a974c40176a
|
|
BLAKE2b-256 checksum How to use checksums |
46fa8433592b1a7b298596a059a58ade7c6b044d8e6c074b208a8b83d1993786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp310-cp310-win_amd64.whl
| Download URL | moselpy-9.9.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 112.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c10809b33ebd81bade1c5ffab9edb7de018519fbcfb987a10d22413df15bcae2
|
|
BLAKE2b-256 checksum How to use checksums |
65a85f6c0df8d447a2c22a6ac6954b355947ef6a90ea5a2f5158f4a8e9cc9d8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | moselpy-9.9.1-cp310-cp310-manylinux2014_aarch64.whl |
|---|---|
| Size | 166.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
fed54207fb9c540c1425ca80a7a56e5e7ec62dc4fe1d87559ca2144065a054f7
|
|
BLAKE2b-256 checksum How to use checksums |
7eea500cc06f760b355381a59e6a981261feee32cc0ec57a6d22614a66ce6d84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp310-cp310-manylinux1_x86_64.whl
| Download URL | moselpy-9.9.1-cp310-cp310-manylinux1_x86_64.whl |
|---|---|
| Size | 176.1 kB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
4ee783056cddee278cc7a6ab1242b5b1b6d405078218cc2439c95a49dafce243
|
|
BLAKE2b-256 checksum How to use checksums |
d31253d052ef8dc794817bcdd00b0cd62883691f4f18fa8a378a76aee1ec6e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / moselpy-9.9.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | moselpy-9.9.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 142.0 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0a65f41eeab590a69c7e21f1d147335e7b05036e671907754a5e918b4532bd11
|
|
BLAKE2b-256 checksum How to use checksums |
61e5d65653b3ad2521671d708a0f5ddf88424632112ed470238948f10ef10e8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for moselpy 9.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.