Data in the Sleep as Android app comes in a CSV file that is very difficult to process with the aim of examining it because each sleep record is of variable length. It's made up of header rows and values rows.
This project is designed to process sleep data in its raw format and output it into a more friendly format.
Right now, this just takes a CSV file from the Sleep as Android app and converts it into a JSON file, but future goals are to allow for more options and move on to sleep data from other systems, including CPAP machines.
Original Sleep as Android CSV file:
Script output:
Resulting JSON file:
Using this is easy! From the main folder of this repository, simply create the path /sleep-as-android/csv/
and place your sleep-export.csv
file there.
Alternatively, you can change the relative file path in main.py
.
26th December 2021: The MVP is almost done, after which a proper versioning process will be put in place. It currently outputs a monthly JSON file for Sleep as Android CSV files, but if there is any noise recording it will simply exclude that row from the output.
Language: Python 3.9.7
Handles files: CSV, JSON
Distributed under the GNU GPL v3 license. See LICENSE
for more information.