Skip to main content

A python implementation of the Unisens standard

Project description

Python package

pyunisens

Implementation of the Unisens data storage format

Installation

Stable version can be installed via pip install pyunisens

or most recent version via pip install git+https://github.com/Unisens/pyunisens

pyunisens is running on Python 3.6+

Quickstart

You can load any unisens object simply like this

import unisens

u = unisens.Unisens('c:/folder/dataset/') # folder containing the unisens.xml

Entries are saved under .entries can be accessed either via attributes or using the unisens object as a dictionary

print(u.entries)

# four ways to Rome
signal = u.signal_bin
signal = u['signal.bin']
signal = u.entries['signal.bin']
signal = u[0]

# shortcuts also work, if they are not ambiguous
signal = u.signal
signal = u['signal']

print(type(signal))
# signalEntry

Data can be loaded (if datatypeis supported, ie a standard numpy dtype) via data= signal.get_data()

You can add Entries simply by

import numpy as np
from unisens import SignalEntry

data = np.random(2, 2560)
s = SignalEntry(id='eeg.bin', parent=u)
# parent=u makes sure the signal is added to this Unisens object
# saving the data to eeg.bin
s.set_data(data, sampleRate=256, contentClass='EEG')

u.save() # will update the unisens.xml

Documentation

More documentation can be found at API-OVERVIEW.md and in the function descriptors

Bug reports / feedback

Please report any bugs or improvements via a Github issue.

Project details


Download files

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

Source Distribution

pyunisens-1.5.0.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

pyunisens-1.5.0-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page