Skip to main content

mathoptmodel

mathoptmodel is the Python package of MathOptSolversCMake: Python bindings for the solver-independent part of the library, its MathOptModel optimization-model structure and its MPS, LP, JSON and AMPL .nl readers and writers. No solver is bundled. Requires Python 3.12 or newer (a single stable-ABI wheel per platform).

pip install mathoptmodel
import mathoptmodel as mom

model = mom.read("p0033.mps.gz")  # format from the extension; .gz/.bz2 handled
print(model.number_of_variables, model.number_of_constraints)

# Arrays are read-only NumPy views onto the C++ model (no copy).
starts = model.constraints_starts
for i in range(model.number_of_constraints):
    begin, end = starts[i], model.constraint_end(i)
    variables = model.elements_variables[begin:end]
    coefficients = model.elements_coefficients[begin:end]
    print(model.constraint_name(i), model.constraint_class(i), dict(zip(variables, coefficients)))

mom.write(model, "p0033.lp")

The fields mirror MathOptModel in mathopt.hpp, which documents each of them, including the expression-tree layout of nonlinear objectives and constraints. variables_types and constraints_classes are int8 arrays of VariableType / ConstraintClass values.

Building from source

pip install .
pytest python/tests

Metadata

Release files for mathoptmodel 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mathoptmodel 0.1.0
File Size Uploaded Provenance Actions
mathoptmodel-0.1.0.tar.gz 102.3 kB With provenance Details for mathoptmodel-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mathoptmodel 0.1.0
File Actions
mathoptmodel-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for mathoptmodel-0.1.0-cp312-abi3-win_amd64.whl
mathoptmodel-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for mathoptmodel-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
mathoptmodel-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for mathoptmodel-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
mathoptmodel-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for mathoptmodel-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
mathoptmodel-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl CPython 3.12 abi3 macOS 10.15+ x86-64 Details for mathoptmodel-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl

Total release size: 1.4 MB

Release files / mathoptmodel-0.1.0.tar.gz

Download URL mathoptmodel-0.1.0.tar.gz
Size 102.3 kB
Tags Source
SHA-256 checksum
How to use checksums
757b5a459c659bef76b3539064cf19802c3563345f800af9df71da1c2501070e
BLAKE2b-256 checksum
How to use checksums
1a3fb5274ad79c939bf1e24755c3fbed9462fbbf83acb120b775067b39be9d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mathoptmodel-0.1.0-cp312-abi3-win_amd64.whl

Download URL mathoptmodel-0.1.0-cp312-abi3-win_amd64.whl
Size 390.9 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8c3b85bdb687280d3470530e648cacba2986b76e6106a35cb41e216650e5b03e
BLAKE2b-256 checksum
How to use checksums
e17b626c6e145c97e8eb37f3be573a11ae9a78fc5f2155df5f07ac02b980cdaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mathoptmodel-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL mathoptmodel-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 256.1 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6741fed8693ec6ab04966efc60b348d2f571d3818772274ccc824f0c599c9a33
BLAKE2b-256 checksum
How to use checksums
77f1d39a2ba4bddce0ab8bf59826035bda97606442748d228b16a1325dbacce6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mathoptmodel-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL mathoptmodel-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 228.8 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
fbfa3116b6addaa146c228c4e89ccdc2cf9a47d852b3760031dd1733951f28bf
BLAKE2b-256 checksum
How to use checksums
93f68f5f3875f5f76d72e2e1ba2af54e976f08b86a9413f0183e9be7baf2f852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mathoptmodel-0.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL mathoptmodel-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 195.3 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0422aec9fb3078be009fb45ac38bfa0b5739699298c8d185b20de6713f78bd1f
BLAKE2b-256 checksum
How to use checksums
be54a09eda6aafca25dc02a7d4b0eaa0eed2626ff38608a09908a0397ebfcc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mathoptmodel-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl

Download URL mathoptmodel-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl
Size 211.8 kB
Tags CPython 3.12 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
3f1393b8bce6b7f91901b5555332e4b95bf772e4dfad1059e7a23ffa99bcc6c1
BLAKE2b-256 checksum
How to use checksums
4eebe5bcb1ce020c315633c9f18c5a9b2612b3bdebccc35f360df78aff29ca84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for mathoptmodel 0.1.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for mathoptmodel-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page