Skip to main content

DHN-MED-Py

Python wrapper for MED format, GPL license 3.0. Commercial exceptions to GPL open source requirements may be negotiated with Dark Horse Neuro, Inc.

Multiscale Electrophysiology Data Format (MED) is an open source data format developed to manage big data in electrophysiology and facilitate data sharing.

The MED format is maintained by MEDFormat.org.

Installation

To install please use:

pip install dhn-med-py

Numpy is a required dependency.

Wrapper features

  • Opens all MED format data for reading directly into python environment.
  • Fully open-source (GPL license 3.0) for both C library code and python wrapper.
  • Samples are returned in NumPy arrays for easy and efficient processing.
  • Channel and session metadata are returned in python dictionaries.
  • Threaded file opening and channel reading for optimal performance.
  • Optional matrix (2D NumPy array) output for efficient processing/visualization.
  • Support for major platforms (MacOS, Linux, Windows).
  • Supported format in the Neo project.

Sample Script

#!/usr/bin/env python3

import dhn_med_py
  
from dhn_med_py import MedSession

# open session
sess = MedSession("/Users/JohnDoe/Desktop/MED-test/RawData.medd", "password")

print("First channel name:", sess.session_info['channels'][0]['metadata']['channel_name'])
sampling_rate = sess.session_info['channels'][0]['metadata']['sampling_frequency']
print("Sampling rate of first channel:", sampling_rate)

# read first minute of data, in 1 second chunks
for y in range(0, 60):
    sess.read_by_index(sampling_rate * y, sampling_rate * (y+1))
    print(sess.data['channels'][0]['data'])

# read first minute of data, in 1 second chunks
# negative time means relative to beginning of session
for y in range(0, 60):
    sess.read_by_time(y * -1000000, (y+1) * -1000000)
    print(sess.data['channels'][0]['data'])
    
# read matrix of first 1 minute of data.
# Return 5000 samples of data per channel (matrix has 5000 columns)
# antialiasing will be applied when downsampling (default filter setting is 'antialias')
sess.get_matrix_by_time(0, -60 * 1000000, sample_count=5000)

# print number of samples in each channel of the resulting matrix
print(sess.matrix['sample_count'])

# print the resulting matrix samples (2D Numpy array)
print (sess.matrix['samples'])

# read matrix of first 1 minute of data
# Return a sampling frequency of 3000 Hz.
sess.get_matrix_by_time(0, -60 * 1000000, 3000)

# print resulting matrix
print (sess.matrix['samples'])

# Read entire dataset, with output sampling set to 1000 Hz
sess.get_matrix_by_time('start', 'end', 1000)

# Read first 25000 samples, using the channel "5k_0001" as the reference channel
# This means the first 5 seconds of the session (for all channels) will be read.
# The default output number of samples corresponds to the highest channel
# sampling frequency.
sess.set_reference_channel("5k_0001")
sess.get_matrix_by_index(0, 25000)

# helper function to set detrending (baseline correction) for future matrix calls
sess.set_detrend(True)

# helper function to set trace_ranges.  Matrix calls will return these
# as "minima" and "maxima" in the matrix result.
sess.set_trace_ranges(True)

# helper function to turn off filtering for future matrix calls
sess.set_filter("none")

# free session
del sess

Release files for dhn-med-py 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for dhn-med-py 2.0.6
File
dhn_med_py-2.0.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
dhn_med_py-2.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
dhn_med_py-2.0.6-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
dhn_med_py-2.0.6-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
dhn_med_py-2.0.6-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
dhn_med_py-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
dhn_med_py-2.0.6-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
dhn_med_py-2.0.6-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
dhn_med_py-2.0.6-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
dhn_med_py-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
dhn_med_py-2.0.6-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
dhn_med_py-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
dhn_med_py-2.0.6-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
dhn_med_py-2.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
dhn_med_py-2.0.6-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
dhn_med_py-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 8.8 MB

Release files / dhn_med_py-2.0.6-cp312-cp312-win_amd64.whl

Download URL dhn_med_py-2.0.6-cp312-cp312-win_amd64.whl
Size 232.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d7dfe5cd03a52329883d56e8abf9370507437fe0423a3e43ed4358a76058911b
BLAKE2b-256 checksum
How to use checksums
67d91b25c2b40f164be25969e616967418424201aa5c117b0b784c437025e76c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dhn_med_py-2.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2e71ba7ebe54652619986aac8af6706f21b769cdef97cc9ae5731aac54ba7da4
BLAKE2b-256 checksum
How to use checksums
0d5267b829f8a0df084275a34c78cdb579277a8dd6b3d2d84661aa2f25fc954c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp312-cp312-macosx_11_0_arm64.whl

Download URL dhn_med_py-2.0.6-cp312-cp312-macosx_11_0_arm64.whl
Size 350.3 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7f8faeb6b86623c23a7edd6b57831a45cee685019fbac8e56ded5f3155082e9a
BLAKE2b-256 checksum
How to use checksums
722f16677cab93a1c91f884b1b25c3eb57fc01a28e81870ae61bba98ce5ad5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp312-cp312-macosx_10_13_x86_64.whl

Download URL dhn_med_py-2.0.6-cp312-cp312-macosx_10_13_x86_64.whl
Size 393.8 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
839c3d4216da74b6b302a8e4c6e6c3368a6c183010ca83c260a5efa57c6dadab
BLAKE2b-256 checksum
How to use checksums
2f1ad6d7d73394d92b39227ea8672ed087cb3a9c52156261a62c21c9f4dd2f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp311-cp311-win_amd64.whl

Download URL dhn_med_py-2.0.6-cp311-cp311-win_amd64.whl
Size 232.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
ab7aba7fd7fbd083b2feb0ed88adedbd10615af43f695c62328d6fc110d942a0
BLAKE2b-256 checksum
How to use checksums
a9a090275488d02e9a2f47cbbba5a0bd4b0193377f039b0b7de705457e0be948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dhn_med_py-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
19b16cc4dfb1f49414dec7db84bb4c5aa7613976ea7002106545c16092b6bb2c
BLAKE2b-256 checksum
How to use checksums
4e59d0aff81c381ac8ab5afac24b0a3f11720b929457a59ff19ae1c8afd3bcbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp311-cp311-macosx_11_0_arm64.whl

Download URL dhn_med_py-2.0.6-cp311-cp311-macosx_11_0_arm64.whl
Size 350.3 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3a788185c9f26bc761e54461e21e2806740dd0bb1fb93275de1bfb78ee633999
BLAKE2b-256 checksum
How to use checksums
fae3af5fd3bec3ed0b4890abbc3dc94b6e50205375fc1c90ac79b64bc2a390df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp311-cp311-macosx_10_9_x86_64.whl

Download URL dhn_med_py-2.0.6-cp311-cp311-macosx_10_9_x86_64.whl
Size 390.6 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0bfbc2a641e4374c6dc40cb2f94a3dec5172f7e97a86586d400c9c15b73807fb
BLAKE2b-256 checksum
How to use checksums
d6ec9a59baeeb33b5870fc8d79355811ad5478945a6110e4cf050f326c005603
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp310-cp310-win_amd64.whl

Download URL dhn_med_py-2.0.6-cp310-cp310-win_amd64.whl
Size 232.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7a6bf6a84678a6fea66d7a3585589bc54740800854cf0acdca4e060ea182fa26
BLAKE2b-256 checksum
How to use checksums
e042032cc3f8b50fd935142a3f2c9656aa879aecf3539e0c1aa4312733eadb35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dhn_med_py-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
498e5d9b0e85d4619792fd1385cae630f300b85df49ce5008adf8c13f0f3e11d
BLAKE2b-256 checksum
How to use checksums
c0ebdd38e63051b625d0412d5d513ba65825d691082b5d067fd6b5932fb35b83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp310-cp310-macosx_11_0_arm64.whl

Download URL dhn_med_py-2.0.6-cp310-cp310-macosx_11_0_arm64.whl
Size 350.3 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4ba01a562a04f9d3b77f6300d7c5cb0c4622d2bc511807c2322033ae461d2e0b
BLAKE2b-256 checksum
How to use checksums
607b7b505cecc20459db13cf6843e05a865bd0e0cbc203ca9373fe6a08ad3d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl

Download URL dhn_med_py-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl
Size 390.6 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7710d64cd45b05d17ad5bdf2ef223e7667326491bf7a1c71357dbb3466f82986
BLAKE2b-256 checksum
How to use checksums
ff8d0c9f3bfdcb52eb3dd17ccebd0ec5674e5ddbbd9d4653bb421cb14c87a512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp39-cp39-win_amd64.whl

Download URL dhn_med_py-2.0.6-cp39-cp39-win_amd64.whl
Size 232.5 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
3c11868c969f2dc83537d1b488a137f7717134dc81b91e46b407e7d449f0fae8
BLAKE2b-256 checksum
How to use checksums
8122b9bb50cd7b7efb67e0db153eb976657cacf133e3b47b52b099f6c55d742f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dhn_med_py-2.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8abcb517ea3118f53ce1c083120e4d31234c0dfdd371605756145ab91e2017e5
BLAKE2b-256 checksum
How to use checksums
21f725b5c13c49fa0db32dfa5564f22317a32e5924db4a3d6dcbe9d56d429649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dhn_med_py-2.0.6-cp39-cp39-macosx_11_0_arm64.whl

Download URL dhn_med_py-2.0.6-cp39-cp39-macosx_11_0_arm64.whl
Size 350.3 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
00f59ea6acd15bbec4123236ed5ec645bef329b9f3fb29674ab4d6a31f1267bc
BLAKE2b-256 checksum
How to use checksums
21699f6c6b31c9fd877c3c056560c791d51914a15fdb1b549574dab5d2a8400e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / dhn_med_py-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl

Download URL dhn_med_py-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl
Size 390.6 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
aa34b0ed87c797a0a73d655ffedc5068c5bb9f842b99edb796a67fa1e57304df
BLAKE2b-256 checksum
How to use checksums
ee1856987bafe340576e31e56ac798839af4566302ba27b9744be9179c6e7d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

2.0.6 This release

16 release files

2.0.4

16 release files

2.0.3

16 release files

2.0.2

3 release files

2.0.1

16 release files

2.0.0

16 release files

1.1.3

5 release files

1.1.2

20 release files

1.1.1

22 release files

1.1.0

20 release files

1.0.0

20 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page