Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

MPython logo.

MPython Core

PyPI - Python Version PyPI - License PyPI - Version

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, and SparseArray.
  • 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

  1. Clone the repository:

    git clone https://github.com/MPython-Package-Factory/mpython-core.git
    cd mpython-core
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Running Tests

To run the test suite:

pytest

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. 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

Links

Release files for mpython-core 25.4rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mpython-core 25.4rc1
File Size Uploaded
mpython_core-25.4rc1.tar.gz 48.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mpython-core 25.4rc1
File Interpreter ABI Platform
mpython_core-25.4rc1-py3-none-any.whl Python 3 none any Details

Total release size: 100.5 kB

Release files / mpython_core-25.4rc1.tar.gz

Download URL mpython_core-25.4rc1.tar.gz
Size 48.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f89aae52c599affeb706fe007dfe70ea58b5f4081de80e3af24c6560a90ce3e4
BLAKE2b-256 checksum
How to use checksums
cb530493dacd4f841d559b853ed2b7fab34c9e4cb253f5506d797443c3a2b136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2025.

Transparency log

Release files / mpython_core-25.4rc1-py3-none-any.whl

Download URL mpython_core-25.4rc1-py3-none-any.whl
Size 52.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b492aec9f90b2808c1d8fcef9b14b39fdf5d964ff24dbed587a27b909c111e43
BLAKE2b-256 checksum
How to use checksums
e3798a203c8dd5700fe52382f7fd233d3625780b036216ea0bf6fbedf9f66e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2025.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page