Core Python elements for wrapped MPython packages.
Project description
MPython Core
MPython Core provides Python bindings for MATLAB projects, enabling seamless integration of MATLAB functionalities into Python workflows. This package is designed to facilitate the creation of bindings for MATLAB projects, allowing users to interact with MATLAB objects, functions, and arrays directly from Python.
Features
- MATLAB Integration: Interact with MATLAB objects, functions, and arrays directly from Python.
- Custom Data Types: Includes Python representations of MATLAB data types such as
Cell,Struct,Array, andSparseArray. - Delayed Arrays: Support for delayed evaluation of MATLAB arrays.
- Sparse Matrix Support: Handles MATLAB sparse matrices using
scipy.sparse(if available). - Object-Oriented Design: Provides a clean and extensible API for working with MATLAB projects.
Installation
To install MPython-Core, use pip:
pip install mpython-core
Requirements
- Python 3.9 - 3.13
- MATLAB Runtime (if MATLAB is not installed)
- NumPy
- Optional: SciPy (for sparse matrix support)
Usage
Example: Working with MATLAB Data Types
from mpython import Cell, Struct, Array
# Create a MATLAB cell array
cell = Cell.from_any([[1, 2], [3, 4]])
# Create a MATLAB struct
struct = Struct(a=Array([1, 2, 3]), b="example")
# Access struct fields
print(struct.a)
print(struct["b"])
Development
Setting Up the Development Environment
-
Clone the repository:
git clone https://github.com/MPython-Package-Factory/mpython-core.git cd mpython-core
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Running Tests
To run the test suite:
pytest
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a clear description of your changes.
License
This project is licensed under the GNU General Public License v2 (GPLv2).
Authors
- Johan Medrano (johan.medrano@ucl.ac.uk)
- Yael Balbastre (y.balbastre@ucl.ac.uk)
Links
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpython_core-25.4rc1.tar.gz.
File metadata
- Download URL: mpython_core-25.4rc1.tar.gz
- Upload date:
- Size: 48.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f89aae52c599affeb706fe007dfe70ea58b5f4081de80e3af24c6560a90ce3e4
|
|
| MD5 |
713323b7cb4e633dc3593a05ec54ffae
|
|
| BLAKE2b-256 |
cb530493dacd4f841d559b853ed2b7fab34c9e4cb253f5506d797443c3a2b136
|
Provenance
The following attestation bundles were made for mpython_core-25.4rc1.tar.gz:
Publisher:
publish-to-pypi.yml on MPython-Package-Factory/mpython-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpython_core-25.4rc1.tar.gz -
Subject digest:
f89aae52c599affeb706fe007dfe70ea58b5f4081de80e3af24c6560a90ce3e4 - Sigstore transparency entry: 244996807
- Sigstore integration time:
-
Permalink:
MPython-Package-Factory/mpython-core@8673465b716875e82e7162a23518bc8368b38d58 -
Branch / Tag:
refs/heads/no-spm-dep - Owner: https://github.com/MPython-Package-Factory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@8673465b716875e82e7162a23518bc8368b38d58 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mpython_core-25.4rc1-py3-none-any.whl.
File metadata
- Download URL: mpython_core-25.4rc1-py3-none-any.whl
- Upload date:
- Size: 52.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b492aec9f90b2808c1d8fcef9b14b39fdf5d964ff24dbed587a27b909c111e43
|
|
| MD5 |
48162c6b4b77d0cebb6bbcf05a14cc77
|
|
| BLAKE2b-256 |
e3798a203c8dd5700fe52382f7fd233d3625780b036216ea0bf6fbedf9f66e07
|
Provenance
The following attestation bundles were made for mpython_core-25.4rc1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on MPython-Package-Factory/mpython-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpython_core-25.4rc1-py3-none-any.whl -
Subject digest:
b492aec9f90b2808c1d8fcef9b14b39fdf5d964ff24dbed587a27b909c111e43 - Sigstore transparency entry: 244996814
- Sigstore integration time:
-
Permalink:
MPython-Package-Factory/mpython-core@8673465b716875e82e7162a23518bc8368b38d58 -
Branch / Tag:
refs/heads/no-spm-dep - Owner: https://github.com/MPython-Package-Factory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@8673465b716875e82e7162a23518bc8368b38d58 -
Trigger Event:
push
-
Statement type: