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.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce723efa5097147d857ad49ada655c204b0a886df9d381b5d13de841d570f218 |
|
MD5 | fba988ad3ef80616b1b9a1fabe62ee66 |
|
BLAKE2b-256 | 7302fd411ad509108b7eb4892e9aa539e5e442c4faca561d1119f729aecf48c1 |
Hashes for libpymcr-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11542fd6c8399cfc809925e58e39ff89e0809cf3e8a4bf99a55dd2dd67b6a97c |
|
MD5 | 3446dcc785d12d42e2746352304fbc26 |
|
BLAKE2b-256 | 5c07910492dac9a88ed68ce023fed6c430f714e65c01b0db0f2537f7bfe8b0da |
Hashes for libpymcr-0.1.7-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973b7be41023232dca427e8934510c58ae723d5c939884d78f0b5da45559f651 |
|
MD5 | 6a647873b6918f294fc91e1779ea7d40 |
|
BLAKE2b-256 | f7af0f9316cd78bd57e1be152d084346ddd4ba711486f80c73d21342e6f71b99 |
Hashes for libpymcr-0.1.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10b0bb1713d21d69412517728cb2493c9c8e91e462a9c7bebdcfc3c17ab7888d |
|
MD5 | 56c18ac90da80ab1bb31d1b3ffca420e |
|
BLAKE2b-256 | c79a86ae4ee8eb99a7002efb0b4631bc68bed2ee9f9078e4b25f7ddba9e31a94 |
Hashes for libpymcr-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f9fe7edec92fe43594f75cc118cd802dfdba0ef60ee1a0fa296a16f274b2c4 |
|
MD5 | a39a614816e3e4a3370e0b451a31c010 |
|
BLAKE2b-256 | aee87d6b6d7243736aa0445daa465a065b442a478b4e8fd78abdd59e0ac85c98 |
Hashes for libpymcr-0.1.7-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0b5d956fa5899a1949d0769c9978dedbf7a2249d7587012fa18fbaea8befd1 |
|
MD5 | 72e8c1b282666ef89de3503d1dc0e3bf |
|
BLAKE2b-256 | 4404eb7f6bb7c7f27b9e575c9342e7805366ad1889b68f5d49ab2af6cfea2bc8 |
Hashes for libpymcr-0.1.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d55ac620e5c88deeffe05c189cfdb77b0b89caa6f2b39a391c0431a6f9c22e2 |
|
MD5 | b0087452e9e600360b8fe2bea8334979 |
|
BLAKE2b-256 | 325f19dce3c2e0c49da3029c1aa434a56c26a885249c2b3c9e099fd9f25e72d9 |
Hashes for libpymcr-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 897ed095699ddc6d0fb6099a5cde1bda62170187226fae79501b012c18a1a41e |
|
MD5 | 00d3340124edd0d49a8ca0c6b15bf18a |
|
BLAKE2b-256 | f0ea3dddf8a563f72e4904919af294a9a8f9055a80ecb775e9bb473eaf393c36 |
Hashes for libpymcr-0.1.7-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1816550cd78914063a6270056a9c7cfd91be18066e53ef4d205bb8b468546c83 |
|
MD5 | 821962eaf9ab576dffbfc2aa91d742a5 |
|
BLAKE2b-256 | c6d674726f12e5d8f1e426ceead15c396ee6570a995917fdcfd6af31b557e28c |
Hashes for libpymcr-0.1.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71e47510c36b56c630d4d6305281cc0cf4b94a3cfdf009c95f0c3bbf15a1c711 |
|
MD5 | 15e918aef2c9c26796c33c40f9fc0832 |
|
BLAKE2b-256 | 827a6faff3755bb7354bdd8d1ae63af3dec77dcfe10194baaa9f75864520dd6e |
Hashes for libpymcr-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | def6a8bc29185952bc33f07a1a6300e085ea6d358aa5472c764cfc54e71376d4 |
|
MD5 | fd22bfa97d6e3fe8aaf400369b355376 |
|
BLAKE2b-256 | 377f8d398deb2ccba3ea04ccda2b38d0e853dad992426c582b60c6780b25872a |
Hashes for libpymcr-0.1.7-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d931be7dd017eecfac1cdf4b1287769da1bdf7473f372152e01dc9ee48579d39 |
|
MD5 | 24fa64deba709e31924f1487b8a04981 |
|
BLAKE2b-256 | 98d7814d2c7854df8e88d3fb9880f3bdbb261f1e527cc19e1696b12a0bc8e938 |
Hashes for libpymcr-0.1.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d5020bc3ccc23e690c6ab6915bb22641ec3a7b65cc60a1daca6d36acbc523d |
|
MD5 | 7867e325bbf24f7b7f04d5655313e6b5 |
|
BLAKE2b-256 | 8faf541e83f6789e9a4a299133b82bb0a5dfde5e2556803efa9f667b9ada1e1c |
Hashes for libpymcr-0.1.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41a61004894691468c2470e40cd1bf7bcdc2d6907071da660f5ca5e3592bb747 |
|
MD5 | 7d342f1ee81ec892ed2471186210049b |
|
BLAKE2b-256 | 5f20e00916f96a4a6b03385fd06b9a4a693ad95cd28282d2eb2e648b99e51e51 |
Hashes for libpymcr-0.1.7-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45c84ba3b11ffc8748f85b8fcdecc101bc515f761c74e111386b7d2a590604e |
|
MD5 | d75995fb8d6532f6164dde9ba8d0bbda |
|
BLAKE2b-256 | 7473b45ce28b987edec27a9ad97596d3c8b081cb091f890e08b1b7923017f0f5 |