#
<img align="left" src="https://raw.githubusercontent.com/danielhrisca/asammdf/master/asammdf.png" alt="logo of asammdf" width="128" height="128" />
_asammdf_ is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.
_asammdf_ supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).
_asammdf_ works on Python >= 3.10




[](https://mypy-lang.org/)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/astral-sh/ruff)
---

## Status
| Continuous Integration | Coveralls | Codacy | ReadTheDocs |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [](https://github.com/danielhrisca/asammdf/actions/workflows/main.yml) | [](https://coveralls.io/github/danielhrisca/asammdf?branch=master) | [](https://www.codacy.com/app/danielhrisca/asammdf?utm_source=github.com&utm_medium=referral&utm_content=danielhrisca/asammdf&utm_campaign=badger) | [](http://asammdf.readthedocs.io/en/master/?badge=stable) |
| PyPI | conda-forge |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [](https://badge.fury.io/py/asammdf) | [](https://anaconda.org/conda-forge/asammdf) |
## Project goals
The main goals for this library are:
- to be faster than the other Python-based mdf libraries
- to have clean and easy-to-understand code base
- to have minimal 3rd party dependencies
## Features
- create new mdf files from scratch
- append new channels
- read unsorted MDF v3 and v4 files
- read CAN and LIN bus logging files
- extract CAN and LIN signals from anonymous bus logging measurements
- filter a subset of channels from original mdf file
- cut measurement to specified time interval
- convert to different mdf version
- export to pandas, HDF5, Matlab (v7.3), CSV and parquet
- merge multiple files sharing the same internal structure
- read and save mdf version 4.10 files containing zipped data blocks
- space optimizations for saved files (no duplicated blocks)
- split large data blocks (configurable size) for mdf version 4
- full support (read, append, save) for the following map types (multidimensional array channels):
- mdf version 3 channels with CDBLOCK
- mdf version 4 structure channel composition
- mdf version 4 channel arrays with CNTemplate storage and one of the array types:
- 0 - array
- 1 - scaling axis
- 2 - look-up
- add and extract attachments for mdf version 4
- handle large files (for example merging two files, each with 14000 channels and 5GB size, on a RaspberryPi)
- extract channel data, master channel and extra channel information as _Signal_ objects for unified operations with v3 and v4 files
- time domain operation using the _Signal_ class
- pandas DataFrames are good if all the channels have the same time base
- a measurement will usually have channels from different sources at different rates
- the _Signal_ class facilitates operations with such channels
- graphical interface to visualize channels and perform operations with the files
## Major features not implemented (yet)
- for version 3
- functionality related to sample reduction block: the sample reduction blocks are simply ignored
- for version 4
- experimental support for MDF v4.20 column oriented storage
- functionality related to sample reduction block: the sample reduction blocks are simply ignored
- handling of channel hierarchy: channel hierarchy is ignored
- full handling of bus logging measurements: currently only CAN and LIN bus logging are implemented with the
ability to _get_ signals defined in the attached CAN/LIN database (.arxml or .dbc). Signals can also
be extracted from an anonymous bus logging measurement by providing a CAN or LIN database (.dbc or .arxml)
- handling of unfinished measurements (mdf 4): finalization is attempted when the file is loaded, however
not all the finalization steps are supported
- full support for remaining mdf 4 channel arrays types
- xml schema for MDBLOCK: most metadata stored in the comment blocks will not be available
- full handling of event blocks: events are transferred to the new files (in case of calling methods
that return new _MDF_ objects) but no new events can be created
- channels with default X axis: the default X axis is ignored and the channel group's master channel
is used
- attachment encryption/decryption using user provided encryption/decryption functions; this is not
part of the MDF v4 spec and is only supported by this library
## Usage
```python
from asammdf import MDF
mdf = MDF('sample.mdf')
speed = mdf.get('WheelSpeed')
speed.plot()
important_signals = ['WheelSpeed', 'VehicleSpeed', 'VehicleAcceleration']
# get short measurement with a subset of channels from 10s to 12s
short = mdf.filter(important_signals).cut(start=10, stop=12)
# convert to version 4.10 and save to disk
short.convert('4.10').save('important signals.mf4')
# plot some channels from a huge file
efficient = MDF('huge.mf4')
for signal in efficient.select(['Sensor1', 'Voltage3']):
signal.plot()
```
Check the _examples_ folder for extended usage demo, or the documentation
<http://asammdf.readthedocs.io/en/master/examples.html>
<https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/>
## Documentation
<http://asammdf.readthedocs.io/en/master>
And a nicely written tutorial on the [CSS Electronics site](https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/).
## Contributing & Support
Please have a look at the [contributing guidelines](CONTRIBUTING.md).
If you enjoy this library please consider making a donation to the
[numpy project](https://numfocus.org/donate-to-numpy) or to [danielhrisca using liberapay](https://liberapay.com/danielhrisca/donate).
[](https://liberapay.com/danielhrisca/donate)
### Contributors
Thanks to all who contributed with commits to _asammdf_:
[](https://github.com/danielhrisca/asammdf/graphs/contributors)
## Installation
_asammdf_ is available on
- GitHub: <https://github.com/danielhrisca/asammdf/>
- PyPI: <https://pypi.org/project/asammdf/>
- conda-forge: <https://anaconda.org/conda-forge/asammdf>
```shell
pip install asammdf
# for the GUI
pip install asammdf[gui]
# or for anaconda
conda install -c conda-forge asammdf
```
In case a wheel is not present for your OS/Python versions and you
lack the proper compiler setup to compile the C-extension code, then
you can simply copy-paste the package code to your site-packages. In this
way the Python fallback code will be used instead of the compiled C-extension code.
## Dependencies
asammdf uses the following libraries
- numpy : the heart that makes all tick
- numexpr : for algebraic and rational channel conversions
- wheel : for installation in virtual environments
- pandas : for DataFrame export
- canmatrix : to handle CAN/LIN bus logging measurements
- natsort
- lxml : for canmatrix arxml support
- lz4 : to speed up the disk IO performance
- python-dateutil : measurement start time handling
Optional dependencies needed for exports
- h5py : for HDF5 export
- hdf5storage : for Matlab v7.3 .mat export
- pyarrow : for parquet export
- scipy: for Matlab v4 and v5 .mat export
Other optional dependencies
- PySide6 : for GUI tool
- pyqtgraph : for GUI tool and Signal plotting
- matplotlib : as fallback for Signal plotting
- faust-cchardet : to detect non-standard Unicode encodings
- chardet : to detect non-standard Unicode encodings
- pyqtlet2 : for the GPS window
- isal : for faster zlib compression/decompression
- fsspec : access files stored in the cloud
## Benchmarks
<http://asammdf.readthedocs.io/en/master/benchmarks.html>
Raw data
{
"_id": null,
"home_page": null,
"name": "asammdf",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "read, reader, edit, editor, parse, parser, asam, mdf, measurement",
"author": null,
"author_email": "Daniel Hrisca <daniel.hrisca@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/db/4d/33425bdd1698186da3cdd7ff537e533116e0829191d7e5361274b3a4a233/asammdf-8.6.10.tar.gz",
"platform": null,
"description": "#\n\n<img align=\"left\" src=\"https://raw.githubusercontent.com/danielhrisca/asammdf/master/asammdf.png\" alt=\"logo of asammdf\" width=\"128\" height=\"128\" />\n\n_asammdf_ is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.\n\n_asammdf_ supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).\n\n_asammdf_ works on Python >= 3.10\n\n\n\n\n\n[](https://mypy-lang.org/)\n[](https://github.com/pre-commit/pre-commit)\n[](https://github.com/astral-sh/ruff)\n\n---\n\n\n\n## Status\n\n| Continuous Integration | Coveralls | Codacy | ReadTheDocs |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| [](https://github.com/danielhrisca/asammdf/actions/workflows/main.yml) | [](https://coveralls.io/github/danielhrisca/asammdf?branch=master) | [](https://www.codacy.com/app/danielhrisca/asammdf?utm_source=github.com&utm_medium=referral&utm_content=danielhrisca/asammdf&utm_campaign=badger) | [](http://asammdf.readthedocs.io/en/master/?badge=stable) |\n\n| PyPI | conda-forge |\n| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| [](https://badge.fury.io/py/asammdf) | [](https://anaconda.org/conda-forge/asammdf) |\n\n## Project goals\n\nThe main goals for this library are:\n\n- to be faster than the other Python-based mdf libraries\n- to have clean and easy-to-understand code base\n- to have minimal 3rd party dependencies\n\n## Features\n\n- create new mdf files from scratch\n- append new channels\n- read unsorted MDF v3 and v4 files\n- read CAN and LIN bus logging files\n- extract CAN and LIN signals from anonymous bus logging measurements\n- filter a subset of channels from original mdf file\n- cut measurement to specified time interval\n- convert to different mdf version\n- export to pandas, HDF5, Matlab (v7.3), CSV and parquet\n- merge multiple files sharing the same internal structure\n- read and save mdf version 4.10 files containing zipped data blocks\n- space optimizations for saved files (no duplicated blocks)\n- split large data blocks (configurable size) for mdf version 4\n- full support (read, append, save) for the following map types (multidimensional array channels):\n - mdf version 3 channels with CDBLOCK\n - mdf version 4 structure channel composition\n - mdf version 4 channel arrays with CNTemplate storage and one of the array types:\n - 0 - array\n - 1 - scaling axis\n - 2 - look-up\n- add and extract attachments for mdf version 4\n- handle large files (for example merging two files, each with 14000 channels and 5GB size, on a RaspberryPi)\n- extract channel data, master channel and extra channel information as _Signal_ objects for unified operations with v3 and v4 files\n- time domain operation using the _Signal_ class\n - pandas DataFrames are good if all the channels have the same time base\n - a measurement will usually have channels from different sources at different rates\n - the _Signal_ class facilitates operations with such channels\n- graphical interface to visualize channels and perform operations with the files\n\n## Major features not implemented (yet)\n\n- for version 3\n - functionality related to sample reduction block: the sample reduction blocks are simply ignored\n- for version 4\n - experimental support for MDF v4.20 column oriented storage\n - functionality related to sample reduction block: the sample reduction blocks are simply ignored\n - handling of channel hierarchy: channel hierarchy is ignored\n - full handling of bus logging measurements: currently only CAN and LIN bus logging are implemented with the\n ability to _get_ signals defined in the attached CAN/LIN database (.arxml or .dbc). Signals can also\n be extracted from an anonymous bus logging measurement by providing a CAN or LIN database (.dbc or .arxml)\n - handling of unfinished measurements (mdf 4): finalization is attempted when the file is loaded, however\n not all the finalization steps are supported\n - full support for remaining mdf 4 channel arrays types\n - xml schema for MDBLOCK: most metadata stored in the comment blocks will not be available\n - full handling of event blocks: events are transferred to the new files (in case of calling methods\n that return new _MDF_ objects) but no new events can be created\n - channels with default X axis: the default X axis is ignored and the channel group's master channel\n is used\n - attachment encryption/decryption using user provided encryption/decryption functions; this is not\n part of the MDF v4 spec and is only supported by this library\n\n## Usage\n\n```python\nfrom asammdf import MDF\n\nmdf = MDF('sample.mdf')\nspeed = mdf.get('WheelSpeed')\nspeed.plot()\n\nimportant_signals = ['WheelSpeed', 'VehicleSpeed', 'VehicleAcceleration']\n# get short measurement with a subset of channels from 10s to 12s\nshort = mdf.filter(important_signals).cut(start=10, stop=12)\n\n# convert to version 4.10 and save to disk\nshort.convert('4.10').save('important signals.mf4')\n\n# plot some channels from a huge file\nefficient = MDF('huge.mf4')\nfor signal in efficient.select(['Sensor1', 'Voltage3']):\n signal.plot()\n```\n\nCheck the _examples_ folder for extended usage demo, or the documentation\n<http://asammdf.readthedocs.io/en/master/examples.html>\n\n<https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/>\n\n## Documentation\n\n<http://asammdf.readthedocs.io/en/master>\n\nAnd a nicely written tutorial on the [CSS Electronics site](https://canlogger.csselectronics.com/canedge-getting-started/ce3/log-file-tools/asammdf-gui/).\n\n## Contributing & Support\n\nPlease have a look at the [contributing guidelines](CONTRIBUTING.md).\n\nIf you enjoy this library please consider making a donation to the\n[numpy project](https://numfocus.org/donate-to-numpy) or to [danielhrisca using liberapay](https://liberapay.com/danielhrisca/donate).\n\n[](https://liberapay.com/danielhrisca/donate)\n\n### Contributors\n\nThanks to all who contributed with commits to _asammdf_:\n\n[](https://github.com/danielhrisca/asammdf/graphs/contributors)\n\n## Installation\n\n_asammdf_ is available on\n\n- GitHub: <https://github.com/danielhrisca/asammdf/>\n- PyPI: <https://pypi.org/project/asammdf/>\n- conda-forge: <https://anaconda.org/conda-forge/asammdf>\n\n```shell\npip install asammdf\n# for the GUI\npip install asammdf[gui]\n# or for anaconda\nconda install -c conda-forge asammdf\n```\n\nIn case a wheel is not present for your OS/Python versions and you\nlack the proper compiler setup to compile the C-extension code, then\nyou can simply copy-paste the package code to your site-packages. In this\nway the Python fallback code will be used instead of the compiled C-extension code.\n\n## Dependencies\n\nasammdf uses the following libraries\n\n- numpy : the heart that makes all tick\n- numexpr : for algebraic and rational channel conversions\n- wheel : for installation in virtual environments\n- pandas : for DataFrame export\n- canmatrix : to handle CAN/LIN bus logging measurements\n- natsort\n- lxml : for canmatrix arxml support\n- lz4 : to speed up the disk IO performance\n- python-dateutil : measurement start time handling\n\nOptional dependencies needed for exports\n\n- h5py : for HDF5 export\n- hdf5storage : for Matlab v7.3 .mat export\n- pyarrow : for parquet export\n- scipy: for Matlab v4 and v5 .mat export\n\nOther optional dependencies\n\n- PySide6 : for GUI tool\n- pyqtgraph : for GUI tool and Signal plotting\n- matplotlib : as fallback for Signal plotting\n- faust-cchardet : to detect non-standard Unicode encodings\n- chardet : to detect non-standard Unicode encodings\n- pyqtlet2 : for the GPS window\n- isal : for faster zlib compression/decompression\n- fsspec : access files stored in the cloud\n\n## Benchmarks\n\n<http://asammdf.readthedocs.io/en/master/benchmarks.html>\n",
"bugtrack_url": null,
"license": "LGPLv3+",
"summary": "ASAM MDF measurement data file parser",
"version": "8.6.10",
"project_urls": {
"Documentation": "https://asammdf.readthedocs.io/en/master",
"Issues": "https://github.com/danielhrisca/asammdf/issues",
"Source": "https://github.com/danielhrisca/asammdf"
},
"split_keywords": [
"read",
" reader",
" edit",
" editor",
" parse",
" parser",
" asam",
" mdf",
" measurement"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "04a7c4331d943b1ecaadbec77be94ec4131461cb52dc7fb3a83ee4bf5c1a05b7",
"md5": "9e4eeb5bd4e079853f2a838409e881c5",
"sha256": "a061b9fb54a1f0518ef35b1f6cb7f9e60b7fa7f29fec86ac27e2ac1bd2205d2e"
},
"downloads": -1,
"filename": "asammdf-8.6.10-cp310-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "9e4eeb5bd4e079853f2a838409e881c5",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1179364,
"upload_time": "2025-08-08T11:12:52",
"upload_time_iso_8601": "2025-08-08T11:12:52.704543Z",
"url": "https://files.pythonhosted.org/packages/04/a7/c4331d943b1ecaadbec77be94ec4131461cb52dc7fb3a83ee4bf5c1a05b7/asammdf-8.6.10-cp310-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "14bd1e998d255b2ed41c8a3c340f744323a17dda1e9e7a593563bdbfe924370a",
"md5": "2173d53585e3052a5312e7bcd3ba2fab",
"sha256": "238bb1dbe05505cdaf25f2aaf95f2040a10ec8d29e406be00f9d9ade3b2ec546"
},
"downloads": -1,
"filename": "asammdf-8.6.10-cp310-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "2173d53585e3052a5312e7bcd3ba2fab",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1170474,
"upload_time": "2025-08-08T11:12:54",
"upload_time_iso_8601": "2025-08-08T11:12:54.954708Z",
"url": "https://files.pythonhosted.org/packages/14/bd/1e998d255b2ed41c8a3c340f744323a17dda1e9e7a593563bdbfe924370a/asammdf-8.6.10-cp310-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7e6254d74b8031493978a62f8484e44b498d9f6afed75cdcee8d617f169b36e4",
"md5": "e767d263fb880492512c1193a6c1c3e7",
"sha256": "8ce89329fcea89362ce39059cf7e58be40eec884b4aaa72fb628d388dea01f4a"
},
"downloads": -1,
"filename": "asammdf-8.6.10-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "e767d263fb880492512c1193a6c1c3e7",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1174398,
"upload_time": "2025-08-08T11:12:56",
"upload_time_iso_8601": "2025-08-08T11:12:56.111997Z",
"url": "https://files.pythonhosted.org/packages/7e/62/54d74b8031493978a62f8484e44b498d9f6afed75cdcee8d617f169b36e4/asammdf-8.6.10-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e50f06f56af2b47ec60d6db16a35b0118c8083c458011f374424b2dff7c021d6",
"md5": "f4805fe2e975b5bd0f60b1eb039aa54a",
"sha256": "d06ebdca472e0335facb7a42671103ef91c5d6f12d0a50ba4cdb1bae0094ad30"
},
"downloads": -1,
"filename": "asammdf-8.6.10-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "f4805fe2e975b5bd0f60b1eb039aa54a",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1177163,
"upload_time": "2025-08-08T11:12:57",
"upload_time_iso_8601": "2025-08-08T11:12:57.544841Z",
"url": "https://files.pythonhosted.org/packages/e5/0f/06f56af2b47ec60d6db16a35b0118c8083c458011f374424b2dff7c021d6/asammdf-8.6.10-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "386e17178e340790a160990402fd75b3049f7752f82f420b0f694e0618a5f0ed",
"md5": "d3fc5cc909445552292948053d3567d3",
"sha256": "daa1385c5bb9cec219cfc88b14eb5613a22be38da25e8ee7e0393798b6250948"
},
"downloads": -1,
"filename": "asammdf-8.6.10-cp310-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "d3fc5cc909445552292948053d3567d3",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1176890,
"upload_time": "2025-08-08T11:12:58",
"upload_time_iso_8601": "2025-08-08T11:12:58.649888Z",
"url": "https://files.pythonhosted.org/packages/38/6e/17178e340790a160990402fd75b3049f7752f82f420b0f694e0618a5f0ed/asammdf-8.6.10-cp310-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "db4d33425bdd1698186da3cdd7ff537e533116e0829191d7e5361274b3a4a233",
"md5": "ceff5fc31e4151900e597e67e5730db8",
"sha256": "c8337bce6fe4e0dfe8e28bc825e59b78b3b68b3f8c85cbbe77dca0f6c82113b0"
},
"downloads": -1,
"filename": "asammdf-8.6.10.tar.gz",
"has_sig": false,
"md5_digest": "ceff5fc31e4151900e597e67e5730db8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 9149842,
"upload_time": "2025-08-08T11:13:00",
"upload_time_iso_8601": "2025-08-08T11:13:00.352750Z",
"url": "https://files.pythonhosted.org/packages/db/4d/33425bdd1698186da3cdd7ff537e533116e0829191d7e5361274b3a4a233/asammdf-8.6.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 11:13:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "danielhrisca",
"github_project": "asammdf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "asammdf"
}