Skip to content

Josh5A/sleep-data-processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sleep Data Processor

Script for processing Sleep Cycle data exports

Background

I wrote this script to make it easy for me to turn my Sleep Cycle app data into visual sleep charts showing sleep and wake times and hours slept.

These charts are used to diagnose and manage sleep and circadian rhythm disorders.

Example sleep chart made with this script:

image

Usage

Setup

This script is designed to work with this Google Sheets template.

  1. Open the Google Sheets template link

  2. Choose "File" > "Make a Copy"

Process sleep log

  1. Export your Sleep Cycle data — Instructions are here

  2. Place the exported data file in the files directory (or edit the file path in bin/process-chart.php to point to your file location).

  3. Run bin/process-chart.php

php -f bin/process-chart.php
  1. Open the files/sleep_chart_output.tdv file in a text editor.

  2. Copy the contents of the file

  3. Go to the Google Sheet, select cell A2, and paste. You should see a chart appear.

Updating your sleep log

  1. Move or rename the old files/sleepdata.csv file.

  2. Follow the same steps above to update your chart. Sleep Cycle always exports your entire sleep log history, so you can just paste over the previous data from the top.

About

Script for processing Sleep Cycle data exports

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages