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
.
- v1.0.2: 28th December 2021
- FIX: Errors when running on a web server caused by attempt to subscript types such as
dict[str, str].
- CHANGE: Add ability to specify output directory for JSON files.
- FIX: Errors when running on a web server caused by attempt to subscript types such as
- v1.0.1: 26th December 2021
- CHANGE: Update of README.
- v1.0.0: 26th December 2021
- Original project launch.
Language: Python 3.9.7
Handles files: CSV, JSON
Distributed under the GNU GPL v3 license. See LICENSE
for more information.