Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
The package provides the mat4py module with the functions loadmat
and
savemat
that allows for reading resp. writing data in the Matlab (TM)
MAT-file format.
Matlab data is loaded into basic Python data types. Matrices are stored row-major using lists of lists. Matlab structs and cells are represented using Python dicts.
The package can be run from the command line, in which case, it provides a routine for converting Matlab MAT-files to/from JSON files.
The function loadmat
loads all variables stored in the MAT-file into
a simple Python data structure, using only Python's dict and list
objects. Numeric and cell arrays are converted to row-ordered nested lists. Arrays are squeezed to eliminate arrays with only one element.
The resulting data structure is composed of simple types that are compatible
with the JSON format.
Example: Load a MAT-file into a Python data structure::
data = loadmat('datafile.mat')
The variable data
is a dict with the variables and values contained in the MAT-file.
Python data can be saved to a MAT-file, with the function savemat
. Data has
to be structured in the same way as for loadmat
, i.e. it should be composed
of simple data types, like dict, list, str, int and float.
Example: Save a Python data structure to a MAT-file::
savemat('datafile.mat', data)
The parameter data
shall be a dict with the variables.
The package can be run from the command line, in which case, it provides a routine for converting Matlab MAT-files to/from JSON files.
Call::
python -m mat4py.cmd -h
to get help with command line usage.
The following Matlab data structures/types are not supported:
The MIT License (MIT) Copyright (c) 2011-2023 Nephics AB
See the LICENSE.txt
file.
FAQs
Load and save data in the Matlab (TM) MAT-file format.
We found that mat4py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.