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.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdce3279481e196e33ff6dafc9f1ec596bedc82a76d773320c3f121a4c8949c1 |
|
MD5 | c28b2c45eee237220a310c9d6da82201 |
|
BLAKE2b-256 | c119ab346c6629b9fd62be3dd8bc505dc0b6906f49595291fd9aebefd77d179c |
Hashes for libpymcr-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89607c5ed33eee8641c6b94119ce83bdd39cb374a7be1fd0fe8dc2c0b77ad4b2 |
|
MD5 | bbd7f471deb95c15c7a8da4c20000a0b |
|
BLAKE2b-256 | 4c7d0c011b27855c4f7eb8d7d6bc6717f5359c63a94b12c4bba7bc86f02e0a8d |
Hashes for libpymcr-0.1.5-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 489bdbf7b1affc3335583fa1b079bb2db1d643f515b1620cbb3d05a8bcab167d |
|
MD5 | 34f4d662068cb6c2e1288fdbf724f81f |
|
BLAKE2b-256 | 39dae49046e8b5d417e5c74875dc09d1bd0df9ef3693bcc1f6e8e1afe0ed000a |
Hashes for libpymcr-0.1.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036577e91e3f8b67e4ad059b89535fb5d2cfd340128518424047cd0c1660fda3 |
|
MD5 | d47363276f8053f4cad193772cdbfd4a |
|
BLAKE2b-256 | 57aae1e5e26358fe43144f21acdaa6ca746fbdd5afc540809771455f58204645 |
Hashes for libpymcr-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e67cc1739d0a2087e03ab13b477d98c82041685eef809d7c4102c8b8250612b |
|
MD5 | 9bd7f8bb730565b28f89a84254ea5b71 |
|
BLAKE2b-256 | 14118f90f92a642842b275764be89f9976cd209720a2b8cd9d04cd33b08e9859 |
Hashes for libpymcr-0.1.5-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1c644a622bcc9b0e6b83354ce87d9648dcf0194bbee02809c9fde3079325b0 |
|
MD5 | 9742d216c0c7f9f659484e20aeb37a8e |
|
BLAKE2b-256 | 46b7295f8c6afadd8f385c70b5d13d0c646153da554447657bdfe8d1a4b5218a |
Hashes for libpymcr-0.1.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0408db84011e9800c167fd96ae1c2e044ab6f95c7766ab8733e7e4ddbc114fe6 |
|
MD5 | 213b0a1eb590dec61286f322c142949b |
|
BLAKE2b-256 | 2f429df4051b523b3f8520a3b346cd9239c58c2fbd44c0d49ea231e0999e247f |
Hashes for libpymcr-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c7f9cf0b1dccbcf4e1a024674e4e0bb16cbd5222fd4245d0af3adfe67857c3 |
|
MD5 | 67cbbf0e30630461a531517b9a92fb52 |
|
BLAKE2b-256 | ec6e215bb98fe31f4140eed00e6f23dae9db418cadb4797212f2cb7efe069183 |
Hashes for libpymcr-0.1.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bda054099faeae999c4264ab3778bcc1ef4ce12c5d492e740aa90e8dd802dae |
|
MD5 | 1a34849b762069a9bee1e67f9df31398 |
|
BLAKE2b-256 | 0d181c66986b7fa68cc85a9b74b9dd7c03024fe79a14303eb61736f89ace4f92 |
Hashes for libpymcr-0.1.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af4f94185ec5145e4ffc852a2a6ccbda6dd7ed9ef680e0af4fde05ff262ec961 |
|
MD5 | fbee21fdaa7d42fb1cc449fbec223dfe |
|
BLAKE2b-256 | 40d7d40d750274ef1a3b49e105113bb019b28a6a17088cf1b27ccc24928ec6a2 |
Hashes for libpymcr-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4a7e9bef7881fc27077fe6b75579c724e6b99a7624fa2109a845d294af9f0a |
|
MD5 | e3c2b3f77fe856b7d606c24235c6694f |
|
BLAKE2b-256 | 802f4b6254e8cfe8279192bc7fc73d110ebddb003dab7bd1c0cb1f5ee3dad22d |
Hashes for libpymcr-0.1.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01af1493d1ac3f957fddee31630e6e38f32c4d5dbb86ebd5c5a4ff65e689003b |
|
MD5 | b981a224cc73033732a304133aeb52f1 |
|
BLAKE2b-256 | 8e3f6bc7e06d11bd72c14552b5610c6f4bb0d32d8c35b435aa8c6829ab90c1f4 |
Hashes for libpymcr-0.1.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25e63850a9cf6d2a84bd6cfa1658ccab0a674d8eccbf60eb18bb9c01c1e963f |
|
MD5 | 7baa8dd99db0e080403cd9b8d72ec96b |
|
BLAKE2b-256 | 8e80b249e58ba9e3ea1f698933a89f3ab2b922b7444cf682f5c37fa68afc3c44 |
Hashes for libpymcr-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b71194881c246674c3be266d81e12154ab29d447197ee1e8ba4823f5e9344179 |
|
MD5 | 6e3f91bc34a6f1677235d5f7752b237b |
|
BLAKE2b-256 | 5cee25f52741b30bfa0a192bdfecb69a2945e78a447f4932498aba30caf45c17 |
Hashes for libpymcr-0.1.5-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 969172bdeef2476be778514d83ac0dadcba11740942cea9ac918053b86677171 |
|
MD5 | 50c4fc1622a2bb6082abb0a9f9b9ffe4 |
|
BLAKE2b-256 | 79bb16bc65c2e91b9249f5bb5799f394f142d3b9549c91f062c5e8c082bd5edd |