holgern / pyedflib

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.
http://pyedflib.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
214 stars 121 forks source link

Allow objects to input data into EdfReader #174

Open hahnicity opened 2 years ago

hahnicity commented 2 years ago

Currently working on AWS with EDF objects. Making a feature request to allow some kind of objects similar to StringIO or urllib3.HTTPResponse for input into the EdfReader class instead of a filename. Presumably, this could work using a .read() call on the object. This would save on some IO so that objects wouldn't have to be directly written to local disk before reading and could instead stay remote based.

skjerns commented 2 years ago

This is probably not so easily possible, as the library we wrap (edflib) is written in C and works with strings that point to files on the file system. Unfortunately we cannot easily pass FILE objects or streams to it, and the last time I tried to implement that I didn't get further (See also #102 and #100). It would probably be possible somehow, but would need some adaptation of the C code to work with streams.

If you feel comfortable enough in C to work on something like this let me know! Else I have to unfortunately put this on the backend, as I don't have enough time right now do work on this.