# asammdf: a Python reader and editor for ASAM MDF measurement files

> asammdf parses and writes MDF versions 2, 3 and 4, and it also edits, appends channels, converts between versions and exports to pandas, HDF5, Matlab, CSV and parquet. The engineering claim in the README is speed against the other Python MDF libraries, and the price is a native extension and a dependency list that is not small.

**danielhrisca/asammdf** — Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files

- Repository: https://github.com/danielhrisca/asammdf
- Stars: 815 · Forks: 274
- Language: Python
- License: NOASSERTION
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/danielhrisca-asammdf

## Three MDF versions, and the project goals behind them

asammdf is a fast parser and editor for ASAM, the Association for Standardization of Automation and Measuring Systems, MDF files, and it supports MDF versions 2 with the.dat extension, 3 with.mdf and 4 with.mf4. It works on Python 3.10 and later. The project states three goals, and they are worth reading as a design brief rather than marketing. It wants to be faster than the other Python-based MDF libraries, it wants a clean and easy to understand code base, and it wants minimal third party dependencies. Those three pull against each other, and the resolution is visible in the repository. The speed goal is met with a native extension, there is an ext/ directory at the root and a CMakeLists.txt alongside a scikit-build-core build backend, which is why the build system requires numpy at build time. The dependency goal is the one that gives way, because the manifest lists a dozen runtime packages.

## It reads, but it also edits and converts

The feature list is much wider than a parser. asammdf can create new MDF files from scratch and append new channels to existing ones. It can read unsorted MDF v3 and v4 files, which matters because recorded measurement files are frequently not written in a clean order. It can filter a subset of channels from an original file, cut a measurement to a specified time interval, and convert between different MDF versions. It merges multiple files that share the same internal structure, and it reads and saves version 4.10 files that contain zipped data blocks. There are storage-level features too: space optimisations for saved files with no duplicated blocks, and splitting of large data blocks at a configurable size for version 4. And it handles large files, with the README giving a concrete case of merging two files, each with 14000 channels and 5GB of data, on a Raspberry Pi. That single example is the clearest statement of what the library is for.

## The Signal class is the answer to mixed time bases

The most interesting design decision is the Signal abstraction. asammdf can extract channel data, master channel and extra channel information as Signal objects for unified operations across v3 and v4 files, and it does time domain operations with them. The reason it exists is stated in the README. Pandas DataFrames are good if all the channels have the same time base, but a measurement will usually have channels from different sources at different rates. That is the normal case in vehicle and industrial logging, and it is precisely where a DataFrame-based tool falls over. The Signal class gives you one interface for resampling, slicing and aligning channels that were never synchronised. The example directory shows the two shapes of the API, with a file for working with the MDF class and another for working with the Signal class, which is a reasonable way to separate the file-level operations from the signal-level ones.

## Bus logging support is real but partial

CAN and LIN bus logging is one of the areas with the most capability and the clearest limits. The library reads CAN and LIN bus logging files, and it can extract CAN and LIN signals from anonymous bus logging measurements. The mechanism for doing that is a database file, an .arxml or a .dbc, supplied at read time, which carries the signal definitions that the raw log does not. The same applies to anonymous measurements, where signals can also be extracted by providing a CAN or LIN database. Under the not implemented section, the README states that full handling of bus logging measurements is not in place, and that currently only CAN and LIN bus logging are implemented. The dependency list confirms the shape of the design, with canmatrix[arxml,dbc] at 1.2 or later required as a runtime dependency rather than an extra, since decoding a bus log without a signal database is not possible and the library treats that as core rather than optional.

## What the library admits it does not do

The Major features not implemented section is unusually detailed, and it is the most useful part of the README for an adopter. For version 3, functionality related to the sample reduction block is not implemented, and the sample reduction blocks are simply ignored. The same is true for version 4. For version 4 there is experimental support for column oriented storage, handling of the sample reduction block is missing, and channel hierarchy is ignored. Full handling of bus logging measurements is incomplete, as described earlier. Handling of unfinished measurements in MDF 4 is partial, where finalization is attempted when the file is loaded but not all finalization steps are supported. Full support for the remaining version 4 channel array types is not there, even though the implemented set is enumerated in the features list. The XML schema for MDBLOCK is missing, so most metadata stored in the comment blocks will not be available. The practical rule is that a file which uses compression, reduced sampling or hierarchy will parse and lose data quietly rather than fail loudly.

## Installing it and what the dependency matrix costs you

Installation is straightforward because the package is published both on PyPI and on conda-forge under the name asammdf, and the README carries a version badge for each. The packaging tells you what the library is made of. The build backend is scikit-build-core with numpy at 2.0 or newer required at build time, so there is a compile step against the ext/ directory. The runtime dependencies include pandas and numpy, lz4 and zstd for compression, python-dateutil, numexpr, typing-extensions, chardet for decoding, lxml, and isal and deflate but only on x86_64 or AMD64 machines. The optional extras then extend that: decode adds chardet, export adds pyarrow, h5py, hdf5storage, python-snappy and polars, export-matlab-v5 adds scipy, gui adds PySide6, pyqtgraph and pyqtlet2, encryption adds cryptography and keyring, and plot adds matplotlib. There is also a graphical interface for visualising channels and performing operations on files, and the repository carries a demo.dspf file and examples for mf4, the MDF class and the Signal class. The consequence for an adopter is that a minimal install pulls pandas and numpy whether or not you use them, and the GUI is opt-in rather than bundled.

## A permissive-looking licence and a very regular release train

The licence needs care, because the metadata disagrees with itself in a way that matters. The pyproject declares the licence as LGPLv3+, with the classifier for the GNU Lesser General Public License v3 or later, while the repository is listed under a custom licence that GitHub cannot classify, with the terms in the LICENSE file at the root. The LGPL is a reasonable choice for a library with a native extension, since it allows linking from proprietary applications under conditions, but the practical step is to read the LICENSE file rather than assume from the classifier. On maintenance, the repository is not archived and the last push was on 2026-10-21. The release history is a steady line of patch releases: 8.8.25 on 2026-08-26, 8.8.26 on 2026-09-01 and 8.8.27 on 2026-09-07. The version numbering with three components in the eighth series, and releases every few days, is the pattern of a project that ships continuously rather than in major milestones.

## Conclusion

Adopt asammdf if your work involves ASAM measurement data and you need to read, edit or convert large MDF files without leaving Python. Do not adopt it for a small job with a handful of channels, because the package builds a native extension and pulls in pandas, numpy and a stack of codec libraries. Before you commit, read the Major features not implemented section, since sample reduction blocks are ignored and MDF v4 channel hierarchy is not handled, and check whether your files are among the ones it does not support rather than discovering that during analysis.

## FAQ

### What is asammdf?

It is a fast parser and editor for ASAM MDF measurement data files, supporting version 2 (.dat), version 3 (.mdf) and version 4 (.mf4), and working on Python 3.10 and later. It is published on PyPI and on conda-forge as asammdf.

### What can asammdf do besides reading MDF files?

It can create new MDF files from scratch, append channels, filter a subset of channels, cut a measurement to a time interval, convert between MDF versions, merge files sharing the same structure, and export to pandas, HDF5, Matlab v7.3, CSV and parquet.

### What does asammdf not support?

The README lists sample reduction blocks as simply ignored in both version 3 and version 4, channel hierarchy ignored in version 4, experimental support only for column oriented storage, partial handling of unfinished version 4 measurements, and no XML schema for MDBLOCK so most comment block metadata is unavailable.

### How do I extract CAN or LIN signals from an asammdf bus log?

You supply the signal definitions with a database file, an .arxml or a .dbc, when reading the file. The README describes this as the only implemented bus logging support, currently CAN and LIN, and the canmatrix package is a required runtime dependency rather than an extra.

## Sources

- [danielhrisca/asammdf on GitHub](https://github.com/danielhrisca/asammdf)
- [Issues](https://github.com/danielhrisca/asammdf/issues)
- [README](https://github.com/danielhrisca/asammdf/blob/master/README.md)
- [Releases](https://github.com/danielhrisca/asammdf/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/danielhrisca-asammdf
