Skip to main content

Core Python elements for wrapped MPython packages.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpython_core-25.4rc1.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpython_core-25.4rc1-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

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

Hashes for mpython_core-25.4rc1.tar.gz
Algorithm Hash digest
SHA256 f89aae52c599affeb706fe007dfe70ea58b5f4081de80e3af24c6560a90ce3e4
MD5 713323b7cb4e633dc3593a05ec54ffae
BLAKE2b-256 cb530493dacd4f841d559b853ed2b7fab34c9e4cb253f5506d797443c3a2b136

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mpython_core-25.4rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b492aec9f90b2808c1d8fcef9b14b39fdf5d964ff24dbed587a27b909c111e43
MD5 48162c6b4b77d0cebb6bbcf05a14cc77
BLAKE2b-256 e3798a203c8dd5700fe52382f7fd233d3625780b036216ea0bf6fbedf9f66e07

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page