Code Monkey home page Code Monkey logo

pillowdata's Introduction

PillowData

This Python notebook parses the database exported by the sleep tracking mobile app Pillow into Pandas DataFrames for easy manipulation. It can then then produce the summary data and render the plots found in the app.

The advantage of using this code is that it includes the audio events in the graph of the sleep stages as purple vertical lines as seen in the Example Output section below.

Technical Notes

Pillow exports UTC timestampes. I hardcoded in my own timezone with pytz.timezone('US/Eastern'), so you will want to adjust it to your own timezone.

Exporting the output, for example, to share with your doctor, is a bit of a pain. I had the best luck exporting the notebook to markdown and then editing the markdown output to remove everything I didn't want in the document. Then I exported the markdown to universally readable html. This is way more complicated than it needs to be, so consider it an invitation to improve upon my code.

Example Output

Thursday, April 26, 2018 at 11:11 p.m.

<style type="text/css"> *{stroke-linecap:butt;stroke-linejoin:round;} </style>
Time in bed 6:49:34 Sleep quality 58%
Time asleep 6:34:34 Mood 🙁 Not so good
Time to sleep 0:15:00 Notes  
<style type="text/css"> *{stroke-linecap:butt;stroke-linejoin:round;} </style>
Awake 17%⬤ REM 9%⬤
Light Sleep 23%⬤ Deep Sleep 51%⬤

License and Authorship

Author(s): Robert Jacobson

License: © 2018 Robert Jacobson. I intend to share these works with the most permissive license possible. In regions where there is the legal concept of public domain, I release these works into the public domain. In regions that do not have a legal concept of public domain, I release these works under the MIT License. See LICENSE.txt for details.

pillowdata's People

Contributors

rljacobson avatar

Stargazers

 avatar Leah Nguyen avatar Irving avatar InfinityLoop avatar James LeDoux avatar Michael avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.