A package for reading and writing MDF files
Project description
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. Using rayon crate on many parts of the code allows to have faster parsing in a safe and easy way compared to python. To allow efficient data sharing with many other tools, mdfr stores the data using arrow2. Polars (pandas equivalent) use is therefore also straight forward. It can be used the following way:
import mdfr
# load file metadata in memory
obj = mdfr.Mdf('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 a serie
# 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)
# write to mdf4 file, compressed or not
obj.write('file_name', conpression_flag)
Packaging for pip should come later.
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for mdfr-0.2.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd9afa10fd75eaff8067f2a0e4068675c9eb5b06c6cae9a4280727c53728c990 |
|
MD5 | 6ad73ce6028ad7989f3dc9ac556958e9 |
|
BLAKE2b-256 | 446fa420746440a86b264d7b58384fba045f295b028d813b283672d44608cbbb |
Close
Hashes for mdfr-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7c1d61cf7af9bc000b3eb4d3ca8f14e2bd3bbd6c4eed3bc4159f564f74ba695 |
|
MD5 | eb73bd08b3c19fb1d66dd41e6d6e3935 |
|
BLAKE2b-256 | 2b454290d3837df3c0dbec132716af50e2fc84b248bfe7a6895d434b7f428529 |
Close
Hashes for mdfr-0.2.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6596854e629ea96e04dcf5bc5614f2b97011f43118d6b3eddd70107311dc1c9 |
|
MD5 | be00e22ba9aa63dcd4597d8ef5dd3afd |
|
BLAKE2b-256 | 721237c63a3f3c3b24bd0ac76075985a94be0cb6f75e522d9c65669013cf700b |
Close
Hashes for mdfr-0.2.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66933f900fcb95b51f11b27378afecae0a3192e265cb5bf745b1224eaae1c975 |
|
MD5 | f3fa82ce43a7162c9944f13d944a4d1f |
|
BLAKE2b-256 | ea4111c41d306f21cdf2aaa3d386d734a151898266fcfae4472db58d19f05b95 |
Close
Hashes for mdfr-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 409404d3955b9dff853cc97d168661184fef25554893e64537d0187d3948e245 |
|
MD5 | 04be2b7a87bc4862b09fc36ed3757d82 |
|
BLAKE2b-256 | e6e0a1eadef7d44df88c1b4eb4ea4e1734a6ddb5e6954f64b5646959c30a6af9 |
Close
Hashes for mdfr-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a1364ce003d20ff9e1977cbff7a2d1f92a8fcb80b80450ee61b57f2978a4b96 |
|
MD5 | d186d2bc97263e3b3b5960cbe683a448 |
|
BLAKE2b-256 | e23ef115000ee36d74d33929afb6df8c3532003d00005394957cc04df3969b92 |
Close
Hashes for mdfr-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce14d1dd279acf3cc97954398cc8fc4ad623266a9b6f1e069a66ee5e26509a3c |
|
MD5 | 8898aad3b0a90401292ddbafc31093d8 |
|
BLAKE2b-256 | 6984ad5f49a6c70b9c34509166b6395ac8e26bae6f56cc5f9a33200443e6d375 |
Close
Hashes for mdfr-0.2.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c831b2491c8466331aaf2757d5acf58fe548bc26fb33f41395818b9e61354d5 |
|
MD5 | 000e06f2b3e33ffdc5fd5643e963e4b7 |
|
BLAKE2b-256 | 1ed8810d38e6f2fdb0674877f490defe1cfbb87a42869947f47258485f108452 |
Close
Hashes for mdfr-0.2.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707dcc392d8c164ac63a716cce32bc5aee491f0e9c704cea3214a274eb770a15 |
|
MD5 | 72db16646d642d303251c002755f26c5 |
|
BLAKE2b-256 | 2f30d6a3ad9d3ddaec2d1c155c90c7e3cff89ca9e1f8cc4faa6438e8545baaaa |
Close
Hashes for mdfr-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbc5068bb9c09761b7b6680379b86472c00c82be78cf55a5c4c6058281166cea |
|
MD5 | 037787c16f37cae59f2fd730d66483ae |
|
BLAKE2b-256 | 15bd041f84853057e54cb4a1381afc3eeb788c4bb385c85119aebe76574f238c |
Close
Hashes for mdfr-0.2.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79991eba82ee9b6994dcf0b1c94789a9996e0b0c57a1ade36ee12200cd7ac361 |
|
MD5 | 8462b20ab8df7ae1f9d2c0d294eac1ba |
|
BLAKE2b-256 | 18feda38e878c0c3c2ffb7fee3cbac5494fd77a3d661027148630dc97e575d22 |
Close
Hashes for mdfr-0.2.0-cp37-cp37m-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19db4c09555d01246192b635ca80c617a49f7a965f210761d7ffcf22460976bc |
|
MD5 | 07c35525c55933ad2b83fa173385c7b5 |
|
BLAKE2b-256 | 88e11f727bc2cecd6825a892a5f2b74d05f842119f4e44e5b5cfbf62e086af24 |