A module to allow Python to call functions from a compiled Matlab archive
Project description
libpymcr
libpymcr is a Python module for loading a compiled Matlab ctf
archive and running functions within it in Python.
Whilst there is an official Mathworks binding for Python, libpymcr provides a few benefits over the official package:
- It is compatible with versions of Python not supported by Matlab (e.g. 3.10, 3.11, 3.12). Moreover, the supported Python versions are not locked to the Matlab versions, unlike with the official packages.
- When converting data between Matlab and Python it avoids data copies where ever possible by wrapping the underlying arrays
in the target type (
numpy
or MatlabmxArray
). In the official bindings, a data copy is required when converting data from Python to Matlab (inputs to functions). - It provides a simpler syntax, and if you include the provided
call.m
andcall_python.mex
files in your compiled package, you will also be able to access Matlab objects transparently in Python, and pass Python callables to Matlab to evaluate (e.g. in a fitting routine).
Getting started
You can install the package using:
pip install libpymcr
You must create a compiled Matlab archive (ctf
file) of your program using the
Matlab Compiler SDK toolbox,
using the mcc command:
mcc -W CTF:your_program_name -U mfile1 mfile2 mfile3
Then in Python, you can load this and call the Matlab functions with:
import libpymcr
m = libpymcr.Matlab('your_program_name.ctf')
m.mfile1()
The functions, mfile1
, mfile2
etc. are exposed to Python can can be called as methods of the Matlab()
object.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for libpymcr-0.1.6-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a17bae810849ae3cbaf100511012b06f631171e202d62ab3b9565bee5ddadf |
|
MD5 | 821faf07ba2cdfe3ba92a486839ab830 |
|
BLAKE2b-256 | b2660954e495d5bb61a1e415a89b64ab1b082cb7c17f4c8af22155015481ba54 |
Hashes for libpymcr-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cb9f636113590ff2f2d8209e65bfe5395f317328a389ea8061290383cdd9c1a |
|
MD5 | 9a3b5397a2d10a34df1778a35b1fdbbb |
|
BLAKE2b-256 | 868d5b44e3a98767d231ef2f65605601a391ecae1b2900611e1e087102171382 |
Hashes for libpymcr-0.1.6-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91d7930d1647448ebb9c68004b85f30fcfb5c23befe982af82dc11407a735924 |
|
MD5 | 9c2793aa64544e264ed05e7256764088 |
|
BLAKE2b-256 | c583ce2c0af49fee3629e9aa7133a4176b2d430eab14ec36f8b80050b216dc88 |
Hashes for libpymcr-0.1.6-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a13774ad45141e78cfadc4cdc2696ccc556573ed6abb6afe156623cc9b0642 |
|
MD5 | 781c1c85c765914b92e88af2e0977663 |
|
BLAKE2b-256 | e18d7039ed3d2469949e00bb3094770d6ea643aaa9a96bd4f815359749c8b672 |
Hashes for libpymcr-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5dcb30f8c9a7d83dbb8ebd351ae8b0842a326b1808a4a84eaa05c6bd1e1c94f |
|
MD5 | ca0aec1b91da959c9371c41b75d53873 |
|
BLAKE2b-256 | f89f5307a7f7e056fc3811f4b3c66bea07d4ef9497525175896446027077c24a |
Hashes for libpymcr-0.1.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6deb164f1f5dd2cf49d84532523e6e3e980d7ed769cbc0b794e72f29fc047391 |
|
MD5 | 84b3acf074e6e8c8a94a8363583f4575 |
|
BLAKE2b-256 | 72acaf9837363b5d040a2cd7bb5f06525eeceb1e75bfe297a3e40f62188cff6e |
Hashes for libpymcr-0.1.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dbc0540701561b4f7b468955ec9608b997e9c5fd4bdd3ec5d2ab3ee1fb79ff1 |
|
MD5 | 53564fcc5f01ab8400088af5e35f43f0 |
|
BLAKE2b-256 | 18a2adab01b2572cc02fe396484c3a73bffd14c749dcfeeb687cda3ab71c5e61 |
Hashes for libpymcr-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ab25db47d10c048e11540cbf0b27fbfb3026180416564626666bb3cef35d235 |
|
MD5 | a7afe1346cf831bcce822d897d260b0c |
|
BLAKE2b-256 | 34f3d36d8b07f9927a39f443b20ed60b99b431a8ddbb55e5b5b6acafe25f1170 |
Hashes for libpymcr-0.1.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e3c9438c565d02e6ab04da29d14ae4f77fe165b1c0e0a4ff73208bea2a3701 |
|
MD5 | 808f6bbed849c4b2c41e7a79df4b12c8 |
|
BLAKE2b-256 | 3362c466400c89a7cd09eee5396c6696f2091b7df422e0d9a93fcd7233d944fd |
Hashes for libpymcr-0.1.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b16ebcda61ddfbc0a91c5b30c19ed4f5a636f493a71a2c9c85b735fd8418e085 |
|
MD5 | 63148acc8a61460cb80043202a25ed58 |
|
BLAKE2b-256 | 66c2428dbef491e0b495a36063ec1e2e82d4378d12c4bebb1ad4f959879e44b5 |
Hashes for libpymcr-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498fc34d415e250296a6275e9b4cafb56935cd5bd0a39f052b46dd323e1bd643 |
|
MD5 | 5e80b22e3427bf5a01e3682e90cd9a6e |
|
BLAKE2b-256 | 20c5c8537ade4207e7e0e2b83876ab1e60c1b45a27d4d2cadb08c5ce5612f56b |
Hashes for libpymcr-0.1.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e076a0326985c07d2cb31c1a229ac3b77ff1327840fa4ed3ec84cadaf8f3200 |
|
MD5 | e08ad4a90bd74f287d9fcf01f2c9ae26 |
|
BLAKE2b-256 | ee89c592407b0b08771ae3851d0f21a5a1f372fceffd31bf0667454972abd710 |
Hashes for libpymcr-0.1.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af97c4872904f436b2aff5abdb2394ec93cc6b3b84f43049b193cf272ab7963 |
|
MD5 | f73f42c49548cb11bd772e562ab9c5db |
|
BLAKE2b-256 | ff17d56bc879ace8ae0e2fac0e61560a66c56335bd94177f91ecf26f62316235 |
Hashes for libpymcr-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28745aa7500415fd09d772d0ce4fdf47e9ec4f11702041bf3705fb2b4cf859b4 |
|
MD5 | dc0ab16dd4e38412c3bb3be228e3d354 |
|
BLAKE2b-256 | f88a913c39947d1a83051b8bc7dae6612a4b2a34b3c9f15cc7ca7e009c1f658f |
Hashes for libpymcr-0.1.6-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2827b343143275ec556b902eb391440f9c4e2825f8c72f1b01ee7be0146d9b6 |
|
MD5 | cf520065d168c4a5674059061048ded4 |
|
BLAKE2b-256 | a7a40c574f0f4c16a2e19e2b315d490e4dde9f837463ac6415f8bc9b2a4b76c8 |