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.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472975b81daba56ca571584319a6a783e746a8674b5eac2bcf0c8373939cbc13 |
|
MD5 | 2e167df6fccbda1278731f830fa2c277 |
|
BLAKE2b-256 | 9941298e65e5adf7d7278f7e6551dd92ba056302c0f385186493212e5e6a84eb |
Hashes for libpymcr-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cedba600eabd6adacce765b2a215d391ac371cfb5f6e4116f13b4824493d7750 |
|
MD5 | 5a2bca7f40abd1fa4c433409d40754c4 |
|
BLAKE2b-256 | 2059e06938b6bbb05a5de7fb545d71d9dec6cfff14579049f5f399b4f48e52e6 |
Hashes for libpymcr-0.1.3-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43ecec7ee310ebfaff6e4947c5349a6ea2ff318fb9488b4201f3d6303d680800 |
|
MD5 | 69bcb1b31384964924f1b07cd9b13ca2 |
|
BLAKE2b-256 | 2c5553ee8d25cbd3338c50a5cc25a95e5e54a2c91212be96fb44dbd877627747 |
Hashes for libpymcr-0.1.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a6d73c17959c5796b61d43bcfe9af43070f380a8855446cd395343f0a2b26a |
|
MD5 | 179fcf7a081060b05d1c181e2f105fd4 |
|
BLAKE2b-256 | b7e0b76f8e33825e2f2cb9f14958aa599a9053035307713d9eceb3d02816fd00 |
Hashes for libpymcr-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cd8b8bfdad1154ddf70cbcdff5b3e6d9200b99415493a94056f493325aabee8 |
|
MD5 | 55de1efd1d693a740ce36dbe6833cc90 |
|
BLAKE2b-256 | 7f9ec7d4b99ccf290ff2081620165edfe4ac486d755960d81a156fb7feb9268a |
Hashes for libpymcr-0.1.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fa9ea96f188b74be456a0b0e1101644728ba4f710c8d424a616728f347c1897 |
|
MD5 | c67d2dae29cd56aceb5e3ac8fe307e5f |
|
BLAKE2b-256 | 3a0a5022e530abe4ac56229394af43c41b3836c03f65c4c966b524c9dab16715 |
Hashes for libpymcr-0.1.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73bbf6bbbc41372d95467f2efcd850dc88110db640c9ff1b2a953c5e0a908044 |
|
MD5 | 37488ba073be8ca79d80a2d4205506d1 |
|
BLAKE2b-256 | 3961c1753070dd92cdce080cf35bda3cb607608fcf2f60e73cbb6f466d57a1f3 |
Hashes for libpymcr-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f739da3cc861fdc5a53ff482d155f843d3a99ab0eb31dda097eb145b97fcd955 |
|
MD5 | 8251bccc7816be87820c22b6a2581631 |
|
BLAKE2b-256 | 8cf0c2bb85614d1e98e0bab29fa87e77a0e34d150f201e3a82452c2ae5e3aba0 |
Hashes for libpymcr-0.1.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da577c94d1fbc3415158dca1f878510ac24868e73f83f35d941979dedfb0dbaa |
|
MD5 | 22e620f80dd99ade20b722da11d3fe3d |
|
BLAKE2b-256 | fd607a4c2a54d09b237a3eaf6cbe3764519431cbe6d1bca536f94b31936c1021 |
Hashes for libpymcr-0.1.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2130684b31722a15e69413cc9eecd041657d9c498290f992ddf89c7d8da6eeb8 |
|
MD5 | 3a874028ccaa510b9b73d88e43f35a66 |
|
BLAKE2b-256 | f95447114f4de1b1cdc3067125860adb10b7e2bb651ceb8540be4c555230edb9 |
Hashes for libpymcr-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ebc7663151d69a24d10f203792d475bd71031605273965080f2ac127159d614 |
|
MD5 | 6248281322eb3fc57ac5a4cdedc9446b |
|
BLAKE2b-256 | 430b2554940f20ae3fcef1a1008b186453fae829cf751924117b30ff91d990ab |
Hashes for libpymcr-0.1.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f514e0524ecae6f7f898431b9389de16a753047943df94ec699f91a5c06d034 |
|
MD5 | 634b89bfcb89a0639d78fe5a68523341 |
|
BLAKE2b-256 | b1f6dc5157a0ac3a60144a01c86550c1f3e38a4249cd82adb9c874a5702dbdec |
Hashes for libpymcr-0.1.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f0d46cae7f22278da3a068101508a2fe6c1fe7fca29f978a002884c004ebdd |
|
MD5 | e3eb7bf83539f3143c69954b718e68b9 |
|
BLAKE2b-256 | 7d9758d6fd28b22bcc59c9b0303d4e743fbf2bf22cf32c6db6b4bf567856ec9e |
Hashes for libpymcr-0.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5d20813b2fcd56fa4a4fb6bcdb196740719cd67da9feb52c5263b577fa8d86a |
|
MD5 | 2d4476d4c401f35474d5e4b154289beb |
|
BLAKE2b-256 | d5aafc371f7f5d81e5c712937791552d24a0cd1e965f2ddf1d845cb4482a066a |
Hashes for libpymcr-0.1.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e994ad86d8b3b4d2f55963d981f3b2d9fb1b21e8a01317bf9220dc480487d2ca |
|
MD5 | 955eac36a35987fab3c73361146196bb |
|
BLAKE2b-256 | 9915b297cb549e6e508833ba49111111665ebae61da8c2e091705995758b95c9 |