Apnea Board Forum - CPAP | Sleep Apnea
python file converter for EMAY sleep pulse oximeter - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: python file converter for EMAY sleep pulse oximeter (/Thread-python-file-converter-for-EMAY-sleep-pulse-oximeter)



python file converter for EMAY sleep pulse oximeter - joeblough - 12-03-2023

Hi all -

i recently bought the EMAY sleep pulse oximeter and was disappointed that i could not import the data into OSCAR. after having a look around the oscar code, i decided the easiest thing to do was write a python script to convert the CSV file that you can save from the iPhone to a DAT file which conforms to the MD300W1 data file format that oscar already knows how to import.

for now this is a command line program, and needs to be run from the command shell on windows, or terminal.app on OSX. i think giving it any kind of GUI requires tkinter which will be a lot of work (that i have no experience with.) i think perhaps it could be bundled into an application using pyinstaller though, which might alleviate all the problems inherent in setting up a python environment that includes tkinter.

anyway, to use this program on the mac, you just get your CSV file into your mac from the iphone - you can save it into icloud drive from the EMAY app, or you could message or email it to yourself. in Terminal.app, first change directories to where the file lives: example: cd ~/Downloads to go to your downloads folder. then to execute the program, first rename it from emay_to_md300w1.py.txt to emay_to_md300w1.py, and put it in the same directory where your CSV files are. then, type python3 ./emay_to_md300w1.py EMAY_filename.csv and it will run and create EMAY_filename.dat, which you can then import into oscar with the oximetry wizard.

let me know if you have any problems or questions on usage. the script tries to check the first line of the CSV file to make sure it's really an EMAY csv, but beyond that it does not do any other error checking. if the file is malformed the script will probably just terminate without closing the dat file.


RE: python file converter for EMAY sleep pulse oximeter - ElectricalPaul - 03-04-2024

With joeblough's permission, I have updated the program to add more error checking. I've made the code publicly available under a BSD 3-clause license. I can't post a link, so I have to type it out as "github.com slash ElectricalPaul slash emay2medview"

I'll be working on the other improvements joeblough wanted - a GUI and a way to install the program.

I hope this program is as useful to others as it has been to me.