Skip to main content

mdfr

ASAM mdf reader in rust

Currently a personal project to learn rust from past experience with python (mdfreader).

mdfr is currently able to be used from python interpreter (using pyO3) to read mdf 3.x and 4.x files. You can install it with 'pip install mdfr' command. It can be used in pure Rust environment as python-polars, numpy, pyo3 are optional features. You can use the Mdfr struct with its methods and eventually its rust-polars methods to manipulate data. Using rayon crate on many parts of the code allows to have fast parsing in a safe and easy way compared to python. To allow efficient data sharing with many other tools, mdfr stores the data using arrow. Polars (pandas equivalent) use is therefore also straight forward. A C/C++ api is also available allowing to get list of channels, units, description and data using the Arrow CDataInterface.

It can be used the following way with python interpreter:

import mdfr
# load file metadata in memory
obj = mdfr.Mdfr('path/to/file.mdf')
# loads all data in memory
obj.load_all_channels_data_in_memory()
# loads a set of channels in memory, for instance in case there is not enough free memory or for performance
obj.load_channels_data_in_memory({'Channel1', 'Channel2'})
# Returns the numpy array
obj.get_channel_data('channel_name')

# .get_channel_* methods to retrieve channel description, unit, related master name, type and data
# .set_channel_* methods to modify channel description, unit, related master name, type and data
# list of channels in file, or lists of channels grouped by master are available
obj.get_master_channel_names_set()

# To manipulate the file data (cut, resample, merge, etc.), it is possible to use polars:
obj.get_polars_series('channel_name') # returns the polars series
# to get complete dataframe including given channel:
obj.get_polars_dataframe('channel_name')
# add and remove channel
obj.add_channel(channel_name, data, master_channel, master_type, master_flag, unit, description)
# to plot a single channel with matplotlib:
obj.plot('channel_name')

# Export to parquet:
obj.export_to_parquet('file_name', compression_option)
# Export to hdf5:
obj.export_to_hdf5('file_name')
# write to mdf4 file, compressed or not
obj.write('file_name', conpression_algo)

It can also be used from Rust directly with the polars feature enabled:

# Cargo.toml
[dependencies]
mdfr = { version = "0.6", features = ["polars"] }
use mdfr::mdfreader::Mdf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut mdf = Mdf::new("path/to/file.mf4")?;
    mdf.load_all_channels_data_in_memory()?;

    // Single channel as a Polars Series
    let series = mdf.get_channel_polars_series("channel_name")?;
    println!("{}", series);

    // All channels sharing a master as a DataFrame
    // pass None for channels that have no master channel
    let df = mdf.get_channel_polars_dataframe(Some("master_channel_name"))?;
    println!("{}", df);

    // All channel groups as a map of DataFrames keyed by master channel name
    let dataframes = mdf.get_polars_dataframes()?;
    for (master, df) in &dataframes {
        println!("master: {:?}\n{}", master, df);
    }

    Ok(())
}

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mdfr-0.7.2-cp314-cp314-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.14Windows x86-64

mdfr-0.7.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp314-cp314-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

mdfr-0.7.2-cp313-cp313-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.13Windows x86-64

mdfr-0.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp313-cp313-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mdfr-0.7.2-cp312-cp312-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.12Windows x86-64

mdfr-0.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp312-cp312-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mdfr-0.7.2-cp311-cp311-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.11Windows x86-64

mdfr-0.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp311-cp311-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mdfr-0.7.2-cp310-cp310-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.10Windows x86-64

mdfr-0.7.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp310-cp310-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mdfr-0.7.2-cp39-cp39-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.9Windows x86-64

mdfr-0.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mdfr-0.7.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

mdfr-0.7.2-cp39-cp39-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file mdfr-0.7.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 07c32dab687df0d94c8c2d55359054915a1c68c474f8cf814e623ff178c36409
MD5 02749e6c5b64125f220044c820e2b031
BLAKE2b-256 c302bd9c007fc4786f744c992fbabadc1defa36c889621ef7ae05aa2ac422d4f

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bcef484b288228f1bc254b393cc79908596fc77deb14ee30a522665e7a08e5a0
MD5 9943dde28a8fd82e9942923c3c0a2332
BLAKE2b-256 5d570afcdaea84785c2ace475e34f19b1d8dfb6aa6a56a7e99394e5af0b9f660

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 987f4304b235dfb934dabb85565e6e326431e267e6753a9a0aa4189040aa2d31
MD5 1f666e765445043c22ab8cbc8d8cd586
BLAKE2b-256 90360687abf9270a129a946595c014107ecde2677050eef4e779f02736de8cd5

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55c04c93c94671212afc75c613c35fc76afdd722a4f9fb6a4339f6851fe655cb
MD5 8ed0cdc3e126cfcb829fe93aefee7223
BLAKE2b-256 2c89ad2f7c8b9e0a07fa7e7622cfd9b0fe40d778a04bd89ca46e3f5d0e903277

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cb8fd7b14826c5e1260cb91226cbb65e5475406de2926e15e37b0443eda3be80
MD5 fcb45b7ce8a0d7158e59ecf7afc603a9
BLAKE2b-256 dbba4a69a2fb4ff553e2fd3d2bff5e873dbf672bd51aa8f987ab8b45443bef28

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 738ecb260cce339a54634ae419a16ac34dce35113f4a6abdffcf0109b35b506e
MD5 a95db6172ba8b60969d490978fc6cf9f
BLAKE2b-256 bd3315cf4babac57e8d6a7596ed50b1841b91b101b4e0b4dc8f3e9b99c7f08ac

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9e4db4484bdb987658985aaf88af20fdef7a208ef203025e58cd9ce94cf5cae3
MD5 857b3ba5af08428e7f7e11fa2218c120
BLAKE2b-256 d6cf1808a9a9ba4478a0c26034061cb92696c3f123bc71d18ed2b711d2d088b8

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 184894defc8629cf92dcb1ae72478718fc33c3b7aa82bb1e41be97f371b52c4c
MD5 89498c74f499329ace6b8fa4393181ca
BLAKE2b-256 af61a2236854e8d09e7a0963d4d10c9da94993fec6ee37b047adabe9629cb22a

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 aeb5d1f61b4470d9bcaa81b3bcc6cf88045dee41f0e7da0a560edf11d57aaf47
MD5 5977ccf2c409ee2e110ad7731f0ba7bb
BLAKE2b-256 3f86cc719d355fe024e619f30715a5b83e4d35bc1ba157f238f47168b973e99e

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f65af19a0d09150c1ecde4e0d933df6ae27e2c7e6a804c93acd42cd556306bff
MD5 781927dac4360889f12ca68c0c40fdd2
BLAKE2b-256 cdd8a6c2b3535b42f40c455566aabb4fa51fed3526ee21c4a53996b69189cb0e

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 64e440c372a6971edfb8a0df4b8ad11096cf0550b115c69deb1a903557d566cf
MD5 0b4ec6bd70319af9713005661b5d0d6b
BLAKE2b-256 fe01017e446301542986c47d12ff0b52d8ca93f18b855ee170eeb96c293e1ecf

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7e7266f2480832d6d89bf73d0616ec97ca42e46106df1ef330bcdfd3a62cf4f
MD5 e2afdb5d742f46939bab2c25a0de3d99
BLAKE2b-256 f9beb3617ffba17da54abf5a34243269c436989709264776e6582c1b79542852

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9f94fc75ed423d43c49c92425b71b4305792e95abab14e9ad71686c58808c6a9
MD5 fdcf169153d859cb02557b98efa68018
BLAKE2b-256 43abf834173a6ce37695b7e132ea58faf76414089d14f8afee7950ac2479ff50

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7b86d1c8fb077489fd6a3d43df3deea4780e46cb21f13c8a1fab319c14c6551
MD5 524464a8fb837e11d3a9f88a8288ea13
BLAKE2b-256 8e6404d61d4ef1702538fb639df2668e527089aef75b759cc1540fe314c02878

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f5e7fac7d3d82ef1b105e8a391ce05431810cfe98c505ad0da226f015d529b4d
MD5 f04e9f9869f576c19f8626b9f5e79ac3
BLAKE2b-256 142f555d65346d51a59f5abb256bb5ebfa9f409373119afe16f6edcd4df18134

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f1d28c58d3ae748f8671fcbd467eda7fade85e7263a8252c902147251bf271d
MD5 5009a8533063109b884203c12d07e481
BLAKE2b-256 4754b5e6a8d99eba125e112a45a2918c193e71c32e469a185633b77005c16043

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4e25ca6fbaa88959b36c8d041fd8d56b4a5121d3d2893f853e1accc31942a825
MD5 c710c6087f69b1b32c056451d0040806
BLAKE2b-256 5951d51855a6e25313b2af4095a52323f82858b2991ca104cc1078a2b1abac62

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc83d63b910a0f8f80293673c6a79c97861f2125bb07d9bd5531c2b024226643
MD5 f2105fec8cd6e472cd34d3825493a257
BLAKE2b-256 a992a3c8d37207bae76f25f972bc194a92be28bc3e8a4a4262fdca032f487fc8

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91b229091c67a244437c2047d45248fa4d4adc893716d8c33deffac9a41f475b
MD5 f02e79c6611768bf67ce70fde6d939b7
BLAKE2b-256 b3d8ba0a9b8ece7d92304f991398274b298f8be5aae0c0bd4a3d1e32301b3c76

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd28c6d6adc24de2a9171837ae9fc0d8a93e2f098d2f3690e427a978a62bc1df
MD5 5e3765ad8cd0c34dd94c5aa39c5daa4b
BLAKE2b-256 1207ac238e3df3b96a7e338e966c49e3f9c6618ba473d760aa81d4e28a51af91

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e9b697e11048ff33c87ac50c6c9e53243d95999600d65d6176bba8970b8219d0
MD5 6e474add7034dc826d646209a1cea193
BLAKE2b-256 03dbb3006921e6f37350a5bd8914a663977237c3b5459426a584335c6fcbf763

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 730829ce75b79e9f5db270dc62bc627d9264464955158a92bdcb408ffa5d1273
MD5 45fec177290f841cb91ebfb18cef5818
BLAKE2b-256 6b50eb89028d772c516678ccb9b10857a7d62706a737731f3479a62c7493ff5e

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdfr-0.7.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 958617d85aea14ddd1f77c23ee147eb6040e8fd0197098e49fcba4d3be71037c
MD5 9e21b3e439a302462486ef0a41b1d271
BLAKE2b-256 485d05b16e93d7892560cc55dde42a873a22b28a28d12e8b8bcf6c6952d5af09

See more details on using hashes here.

File details

Details for the file mdfr-0.7.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mdfr-0.7.2-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mdfr-0.7.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47e71339f7a408fe26ca9b69340b99fbcd6b1ce38fdb319c7ae03d9a547539ba
MD5 eea8694e11389668f94774b419b9ced0
BLAKE2b-256 fd13c722326c6e781df0a5767a3c8834a4755d12520038f56c7b3b78f593a9cc

See more details on using hashes here.

Supported by

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