rapids/dev/datastreams/fitbitjson-csv/index.html

2515 lines
78 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://www.rapids.science/dev/datastreams/fitbitjson-csv/">
<link rel="icon" href="../../img/logo.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.6+insiders-2.9.1">
<title>fitbitjson_csv - RAPIDS</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.92048cb8.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.73e53a79.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>:root{--md-text-font-family:"Roboto";--md-code-font-family:"Roboto Mono"}</style>
<link rel="stylesheet" href="../../stylesheets/extra.css">
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="blue">
<script>function __scope(t,e="../.."){return new URL(e,location).pathname+"."+t}function __get(t,e=localStorage,n){return JSON.parse(e.getItem(__scope(t,n)))}function __set(t,e,n=localStorage,o){try{n.setItem(__scope(t,o),JSON.stringify(e))}catch(t){}}</script>
<script>var palette=__get("__palette");if(palette&&"object"==typeof palette.color)for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)</script>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#fitbitjson_csv" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<div data-md-component="outdated" hidden>
<aside class="md-banner md-banner--warning">
<div class="md-banner__inner md-grid md-typeset">
You're not viewing the latest stable version of RAPIDS.
<a href="https://rapids.science/latest">
<strong> Click here to go to latest. </strong>
</a>
</div>
<script>var el=document.querySelector("[data-md-component=outdated]"),outdated=__get("__outdated",sessionStorage);!0===outdated&&el&&(el.hidden=!1)</script>
</aside>
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="RAPIDS" class="md-header__button md-logo" aria-label="RAPIDS" data-md-component="logo">
<img src="../../img/logo.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
RAPIDS
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
fitbitjson_csv
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="blue" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3z"/></svg>
</label>
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="blue" data-md-color-accent="blue" type="radio" name="__palette" id="__palette_2">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2m10-3a5 5 0 0 1 5 5 5 5 0 0 1-5 5H7a5 5 0 0 1-5-5 5 5 0 0 1 5-5h10M7 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3h10a3 3 0 0 0 3-3 3 3 0 0 0-3-3H7z"/></svg>
</label>
</form>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/carissalow/rapids/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
carissalow/rapids
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="RAPIDS" class="md-nav__button md-logo" aria-label="RAPIDS" data-md-component="logo">
<img src="../../img/logo.png" alt="logo">
</a>
RAPIDS
</label>
<div class="md-nav__source">
<a href="https://github.com/carissalow/rapids/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
carissalow/rapids
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="../../setup/overview/" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../../workflow-examples/minimal/" class="md-nav__link">
Minimal Example
</a>
</li>
<li class="md-nav__item">
<a href="../../citation/" class="md-nav__link">
Citation
</a>
</li>
<li class="md-nav__item">
<a href="../../contributing/" class="md-nav__link">
Contributing
</a>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6">
Setup
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Setup" data-md-level="1">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../setup/installation/" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="../../setup/configuration/" class="md-nav__link">
Configuration
</a>
</li>
<li class="md-nav__item">
<a href="../../setup/execution/" class="md-nav__link">
Execution
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" checked>
<label class="md-nav__link" for="__nav_7">
Data Streams
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Data Streams" data-md-level="1">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Data Streams
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../data-streams-introduction/" class="md-nav__link">
Introduction
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_2" type="checkbox" id="__nav_7_2" >
<label class="md-nav__link" for="__nav_7_2">
Phone
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Phone" data-md-level="2">
<label class="md-nav__title" for="__nav_7_2">
<span class="md-nav__icon md-icon"></span>
Phone
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../aware-mysql/" class="md-nav__link">
aware_mysql
</a>
</li>
<li class="md-nav__item">
<a href="../aware-csv/" class="md-nav__link">
aware_csv
</a>
</li>
<li class="md-nav__item">
<a href="../aware-influxdb/" class="md-nav__link">
aware_influxdb (beta)
</a>
</li>
<li class="md-nav__item">
<a href="../mandatory-phone-format/" class="md-nav__link">
Mandatory Phone Format
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_3" type="checkbox" id="__nav_7_3" checked>
<label class="md-nav__link" for="__nav_7_3">
Fitbit
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Fitbit" data-md-level="2">
<label class="md-nav__title" for="__nav_7_3">
<span class="md-nav__icon md-icon"></span>
Fitbit
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../fitbitjson-mysql/" class="md-nav__link">
fitbitjson_mysql
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
fitbitjson_csv
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
fitbitjson_csv
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#container" class="md-nav__link">
Container
</a>
</li>
<li class="md-nav__item">
<a href="#format" class="md-nav__link">
Format
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../fitbitparsed-mysql/" class="md-nav__link">
fitbitparsed_mysql
</a>
</li>
<li class="md-nav__item">
<a href="../fitbitparsed-csv/" class="md-nav__link">
fitbitparsed_csv
</a>
</li>
<li class="md-nav__item">
<a href="../mandatory-fitbit-format/" class="md-nav__link">
Mandatory Fitbit Format
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_4" type="checkbox" id="__nav_7_4" >
<label class="md-nav__link" for="__nav_7_4">
Empatica
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Empatica" data-md-level="2">
<label class="md-nav__title" for="__nav_7_4">
<span class="md-nav__icon md-icon"></span>
Empatica
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../empatica-zip/" class="md-nav__link">
empatica_zip
</a>
</li>
<li class="md-nav__item">
<a href="../mandatory-empatica-format/" class="md-nav__link">
Mandatory Empatica Format
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../add-new-data-streams/" class="md-nav__link">
Add New Data Streams
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8">
Behavioral Features
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Behavioral Features" data-md-level="1">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Behavioral Features
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/feature-introduction/" class="md-nav__link">
Introduction
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8_2" type="checkbox" id="__nav_8_2" >
<label class="md-nav__link" for="__nav_8_2">
Phone
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Phone" data-md-level="2">
<label class="md-nav__title" for="__nav_8_2">
<span class="md-nav__icon md-icon"></span>
Phone
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/phone-accelerometer/" class="md-nav__link">
Phone Accelerometer
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-activity-recognition/" class="md-nav__link">
Phone Activity Recognition
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-applications-crashes/" class="md-nav__link">
Phone Applications Crashes
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-applications-foreground/" class="md-nav__link">
Phone Applications Foreground
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-applications-notifications/" class="md-nav__link">
Phone Applications Notifications
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-battery/" class="md-nav__link">
Phone Battery
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-bluetooth/" class="md-nav__link">
Phone Bluetooth
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-calls/" class="md-nav__link">
Phone Calls
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-conversation/" class="md-nav__link">
Phone Conversation
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-data-yield/" class="md-nav__link">
Phone Data Yield
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-keyboard/" class="md-nav__link">
Phone Keyboard
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-light/" class="md-nav__link">
Phone Light
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-locations/" class="md-nav__link">
Phone Locations
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-log/" class="md-nav__link">
Phone Log
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-messages/" class="md-nav__link">
Phone Messages
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-screen/" class="md-nav__link">
Phone Screen
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-wifi-connected/" class="md-nav__link">
Phone WiFI Connected
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-wifi-visible/" class="md-nav__link">
Phone WiFI Visible
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8_3" type="checkbox" id="__nav_8_3" >
<label class="md-nav__link" for="__nav_8_3">
Fitbit
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Fitbit" data-md-level="2">
<label class="md-nav__title" for="__nav_8_3">
<span class="md-nav__icon md-icon"></span>
Fitbit
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/fitbit-calories-intraday/" class="md-nav__link">
Fitbit Calories Intraday
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-data-yield/" class="md-nav__link">
Fitbit Data Yield
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-heartrate-summary/" class="md-nav__link">
Fitbit Heart Rate Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-heartrate-intraday/" class="md-nav__link">
Fitbit Heart Rate Intraday
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-sleep-summary/" class="md-nav__link">
Fitbit Sleep Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-sleep-intraday/" class="md-nav__link">
Fitbit Sleep Intraday
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-steps-summary/" class="md-nav__link">
Fitbit Steps Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-steps-intraday/" class="md-nav__link">
Fitbit Steps Intraday
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8_4" type="checkbox" id="__nav_8_4" >
<label class="md-nav__link" for="__nav_8_4">
Empatica
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Empatica" data-md-level="2">
<label class="md-nav__title" for="__nav_8_4">
<span class="md-nav__icon md-icon"></span>
Empatica
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/empatica-accelerometer/" class="md-nav__link">
Empatica Accelerometer
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-heartrate/" class="md-nav__link">
Empatica Heart Rate
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-temperature/" class="md-nav__link">
Empatica Temperature
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-electrodermal-activity/" class="md-nav__link">
Empatica Electrodermal Activity
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-blood-volume-pulse/" class="md-nav__link">
Empatica Blood Volume Pulse
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-inter-beat-interval/" class="md-nav__link">
Empatica Inter Beat Interval
</a>
</li>
<li class="md-nav__item">
<a href="../../features/empatica-tags/" class="md-nav__link">
Empatica Tags
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../features/add-new-features/" class="md-nav__link">
Add New Features
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9">
Visualizations
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Visualizations" data-md-level="1">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
Visualizations
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../visualizations/data-quality-visualizations/" class="md-nav__link">
Data Quality
</a>
</li>
<li class="md-nav__item">
<a href="../../visualizations/feature-visualizations/" class="md-nav__link">
Features
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10">
Analysis Workflows
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Analysis Workflows" data-md-level="1">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Analysis Workflows
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../workflow-examples/analysis/" class="md-nav__link">
Complete Example
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_11" type="checkbox" id="__nav_11" >
<label class="md-nav__link" for="__nav_11">
Developers
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Developers" data-md-level="1">
<label class="md-nav__title" for="__nav_11">
<span class="md-nav__icon md-icon"></span>
Developers
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../developers/git-flow/" class="md-nav__link">
Git Flow
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/remote-support/" class="md-nav__link">
Remote Support
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/virtual-environments/" class="md-nav__link">
Virtual Environments
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/documentation/" class="md-nav__link">
Documentation
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/testing/" class="md-nav__link">
Testing
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/test-cases/" class="md-nav__link">
Test cases
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/validation-schema-config/" class="md-nav__link">
Validation schema of config.yaml
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_12" type="checkbox" id="__nav_12" >
<label class="md-nav__link" for="__nav_12">
Others
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Others" data-md-level="1">
<label class="md-nav__title" for="__nav_12">
<span class="md-nav__icon md-icon"></span>
Others
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../migrating-from-old-versions/" class="md-nav__link">
Migrating from an old version
</a>
</li>
<li class="md-nav__item">
<a href="../../code_of_conduct/" class="md-nav__link">
Code of Conduct
</a>
</li>
<li class="md-nav__item">
<a href="../../common-errors/" class="md-nav__link">
Common Errors
</a>
</li>
<li class="md-nav__item">
<a href="../../team/" class="md-nav__link">
Team
</a>
</li>
<li class="md-nav__item">
<a href="../../change-log/" class="md-nav__link">
Change Log
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#container" class="md-nav__link">
Container
</a>
</li>
<li class="md-nav__item">
<a href="#format" class="md-nav__link">
Format
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/carissalow/rapids/edit/master/docs/datastreams/fitbitjson-csv.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1 id="fitbitjson_csv"><code>fitbitjson_csv</code><a class="headerlink" href="#fitbitjson_csv" title="Permanent link">&para;</a></h1>
<p>This <a href="../../datastreams/data-streams-introduction">data stream</a> handles Fitbit sensor data downloaded using the <a href="https://dev.fitbit.com/build/reference/web-api/">Fitbit Web API</a> and stored in a CSV file. Please note that RAPIDS cannot query the API directly; you need to use other available tools or implement your own. Once you have your sensor data in a CSV file, RAPIDS can process it.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The CSV files have to use <code>,</code> as separator, <code>\</code> as escape character (do not escape <code>"</code> with <code>""</code>), and wrap any string columns with <code>"</code>.</p>
<details class="example"><summary>Example of a valid CSV file</summary><div class="highlight"><pre><span></span><code>&quot;timestamp&quot;,&quot;device_id&quot;,&quot;label&quot;,&quot;fitbit_id&quot;,&quot;fitbit_data_type&quot;,&quot;fitbit_data&quot;
1587614400000,&quot;a748ee1a-1d0b-4ae9-9074-279a2b6ba524&quot;,&quot;5S&quot;,&quot;5ZKN9B&quot;,&quot;steps&quot;,&quot;{\&quot;activities-steps\&quot;:[{\&quot;dateTime\&quot;:\&quot;2020-04-23\&quot;,\&quot;value\&quot;:\&quot;7881\&quot;}]&quot;
</code></pre></div>
</details>
</div>
<h2 id="container">Container<a class="headerlink" href="#container" title="Permanent link">&para;</a></h2>
<p>The container should be a CSV file per Fitbit sensor, each containing all participants&rsquo; data.</p>
<p>The script to connect and download data from this container is at:
<div class="highlight"><pre><span></span><code>src/data/streams/fitbitjson_csv/container.R
</code></pre></div></p>
<h2 id="format">Format<a class="headerlink" href="#format" title="Permanent link">&para;</a></h2>
<p>The <code>format.yaml</code> maps and transforms columns in your raw data stream to the <a href="../mandatory-fitbit-format">mandatory columns RAPIDS needs for Fitbit sensors</a>. This file is at:</p>
<div class="highlight"><pre><span></span><code>src/data/streams/fitbitjson_csv/format.yaml
</code></pre></div>
<p>If you want RAPIDS to process Fitbit sensor data using this stream, you will need to map <code>DEVICE_ID</code> and <code>JSON_FITBIT_COLUMN</code> to your own raw data columns inside <strong>each sensor</strong> section in <code>format.yaml</code>.</p>
<details class="info"><summary>FITBIT_HEARTRATE_SUMMARY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>HEARTRATE_DAILY_RESTINGHR</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>HEARTRATE_DAILY_CALORIESOUTOFRANGE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>HEARTRATE_DAILY_CALORIESFATBURN</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>HEARTRATE_DAILY_CALORIESCARDIO</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>HEARTRATE_DAILY_CALORIESPEAK</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_heartrate_summary_json.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>All columns except <code>DEVICE_ID</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by Fitbit&rsquo;s API. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the raw data RAPIDS expects for this data stream</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-07&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:1200.6102,&rdquo;max&rdquo;:88,&rdquo;min&rdquo;:31,&rdquo;minutes&rdquo;:1058,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:760.3020,&rdquo;max&rdquo;:120,&rdquo;min&rdquo;:86,&rdquo;minutes&rdquo;:366,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:15.2048,&rdquo;max&rdquo;:146,&rdquo;min&rdquo;:120,&rdquo;minutes&rdquo;:2,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:221,&rdquo;min&rdquo;:148,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:72}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:68},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:67},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:67},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-08&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:1100.1120,&rdquo;max&rdquo;:89,&rdquo;min&rdquo;:30,&rdquo;minutes&rdquo;:921,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:660.0012,&rdquo;max&rdquo;:118,&rdquo;min&rdquo;:82,&rdquo;minutes&rdquo;:361,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:23.7088,&rdquo;max&rdquo;:142,&rdquo;min&rdquo;:108,&rdquo;minutes&rdquo;:3,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:221,&rdquo;min&rdquo;:148,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:70}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:77},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:75},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:73},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-09&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:750.3615,&rdquo;max&rdquo;:77,&rdquo;min&rdquo;:30,&rdquo;minutes&rdquo;:851,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:734.1516,&rdquo;max&rdquo;:107,&rdquo;min&rdquo;:77,&rdquo;minutes&rdquo;:550,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:131.8579,&rdquo;max&rdquo;:130,&rdquo;min&rdquo;:107,&rdquo;minutes&rdquo;:29,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:220,&rdquo;min&rdquo;:130,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:69}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:90},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:89},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:88},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<details class="info"><summary>FITBIT_HEARTRATE_INTRADAY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>HEARTRATE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>HEARTRATE_ZONE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_heartrate_intraday_json.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>All columns except <code>DEVICE_ID</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by Fitbit&rsquo;s API. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the raw data RAPIDS expects for this data stream</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-07&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:1200.6102,&rdquo;max&rdquo;:88,&rdquo;min&rdquo;:31,&rdquo;minutes&rdquo;:1058,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:760.3020,&rdquo;max&rdquo;:120,&rdquo;min&rdquo;:86,&rdquo;minutes&rdquo;:366,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:15.2048,&rdquo;max&rdquo;:146,&rdquo;min&rdquo;:120,&rdquo;minutes&rdquo;:2,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:221,&rdquo;min&rdquo;:148,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:72}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:68},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:67},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:67},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-08&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:1100.1120,&rdquo;max&rdquo;:89,&rdquo;min&rdquo;:30,&rdquo;minutes&rdquo;:921,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:660.0012,&rdquo;max&rdquo;:118,&rdquo;min&rdquo;:82,&rdquo;minutes&rdquo;:361,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:23.7088,&rdquo;max&rdquo;:142,&rdquo;min&rdquo;:108,&rdquo;minutes&rdquo;:3,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:221,&rdquo;min&rdquo;:148,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:70}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:77},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:75},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:73},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;activities-heart&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-09&rdquo;,&rdquo;value&rdquo;:{&ldquo;customHeartRateZones&rdquo;:[],&rdquo;heartRateZones&rdquo;:[{&ldquo;caloriesOut&rdquo;:750.3615,&rdquo;max&rdquo;:77,&rdquo;min&rdquo;:30,&rdquo;minutes&rdquo;:851,&rdquo;name&rdquo;:&rdquo;Out of Range&rdquo;},{&ldquo;caloriesOut&rdquo;:734.1516,&rdquo;max&rdquo;:107,&rdquo;min&rdquo;:77,&rdquo;minutes&rdquo;:550,&rdquo;name&rdquo;:&rdquo;Fat Burn&rdquo;},{&ldquo;caloriesOut&rdquo;:131.8579,&rdquo;max&rdquo;:130,&rdquo;min&rdquo;:107,&rdquo;minutes&rdquo;:29,&rdquo;name&rdquo;:&rdquo;Cardio&rdquo;},{&ldquo;caloriesOut&rdquo;:0,&rdquo;max&rdquo;:220,&rdquo;min&rdquo;:130,&rdquo;minutes&rdquo;:0,&rdquo;name&rdquo;:&rdquo;Peak&rdquo;}],&rdquo;restingHeartRate&rdquo;:69}}],&rdquo;activities-heart-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:90},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:89},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:88},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<details class="info"><summary>FITBIT_SLEEP_SUMMARY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>TIMESTAMP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>LOCAL_START_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>LOCAL_END_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>EFFICIENCY</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>MINUTES_AFTER_WAKEUP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>MINUTES_ASLEEP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>MINUTES_AWAKE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>MINUTES_TO_FALL_ASLEEP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>MINUTES_IN_BED</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>IS_MAIN_SLEEP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>TYPE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_sleep_summary_json.py
- src/data/streams/mutations/fitbit/add_local_date_time.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Fitbit API has two versions for sleep data, v1 and v1.2. We support both but ignore v1&rsquo;s <code>count_awake</code>, <code>duration_awake</code>, and <code>count_awakenings</code>, <code>count_restless</code>, <code>duration_restless</code> columns.</p>
<p>All columns except <code>DEVICE_ID</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by Fitbit&rsquo;s API. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the expected raw data</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-10&rdquo;,&rdquo;duration&rdquo;:3600000,&rdquo;efficiency&rdquo;:92,&rdquo;endTime&rdquo;:&rdquo;2020-10-10T16:37:00.000&rdquo;,&rdquo;infoCode&rdquo;:2,&rdquo;isMainSleep&rdquo;:false,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:36:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;restless&rdquo;,&rdquo;seconds&rdquo;:60},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:37:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;asleep&rdquo;,&rdquo;seconds&rdquo;:660},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:48:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;restless&rdquo;,&rdquo;seconds&rdquo;:60},&hellip;], &ldquo;summary&rdquo;:{&ldquo;asleep&rdquo;:{&ldquo;count&rdquo;:0,&rdquo;minutes&rdquo;:56},&rdquo;awake&rdquo;:{&ldquo;count&rdquo;:0,&rdquo;minutes&rdquo;:0},&rdquo;restless&rdquo;:{&ldquo;count&rdquo;:3,&rdquo;minutes&rdquo;:4}}},&rdquo;logId&rdquo;:26315914306,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:55,&rdquo;minutesAwake&rdquo;:5,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-10T15:36:30.000&rdquo;,&rdquo;timeInBed&rdquo;:60,&rdquo;type&rdquo;:&rdquo;classic&rdquo;},{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-10&rdquo;,&rdquo;duration&rdquo;:22980000,&rdquo;efficiency&rdquo;:88,&rdquo;endTime&rdquo;:&rdquo;2020-10-10T08:10:00.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T01:46:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:420},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T01:53:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;deep&rdquo;,&rdquo;seconds&rdquo;:1230},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T02:14:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:360},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:3,&rdquo;minutes&rdquo;:92,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:29,&rdquo;minutes&rdquo;:193,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:33,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:28,&rdquo;minutes&rdquo;:65,&rdquo;thirtyDayAvgMinutes&rdquo;:0}}},&rdquo;logId&rdquo;:26311786557,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:318,&rdquo;minutesAwake&rdquo;:65,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-10T01:46:30.000&rdquo;,&rdquo;timeInBed&rdquo;:383,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:92,&rdquo;light&rdquo;:193,&rdquo;rem&rdquo;:33,&rdquo;wake&rdquo;:65},&rdquo;totalMinutesAsleep&rdquo;:373,&rdquo;totalSleepRecords&rdquo;:2,&rdquo;totalTimeInBed&rdquo;:443}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-11&rdquo;,&rdquo;duration&rdquo;:41640000,&rdquo;efficiency&rdquo;:89,&rdquo;endTime&rdquo;:&rdquo;2020-10-11T11:47:00.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:12:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:450},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:20:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:870},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:34:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:780},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:52,&rdquo;thirtyDayAvgMinutes&rdquo;:62},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:32,&rdquo;minutes&rdquo;:442,&rdquo;thirtyDayAvgMinutes&rdquo;:364},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:6,&rdquo;minutes&rdquo;:68,&rdquo;thirtyDayAvgMinutes&rdquo;:58},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:29,&rdquo;minutes&rdquo;:132,&rdquo;thirtyDayAvgMinutes&rdquo;:94}}},&rdquo;logId&rdquo;:26589710670,&rdquo;minutesAfterWakeup&rdquo;:1,&rdquo;minutesAsleep&rdquo;:562,&rdquo;minutesAwake&rdquo;:132,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-11T00:12:30.000&rdquo;,&rdquo;timeInBed&rdquo;:694,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:52,&rdquo;light&rdquo;:442,&rdquo;rem&rdquo;:68,&rdquo;wake&rdquo;:132},&rdquo;totalMinutesAsleep&rdquo;:562,&rdquo;totalSleepRecords&rdquo;:1,&rdquo;totalTimeInBed&rdquo;:694}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-12&rdquo;,&rdquo;duration&rdquo;:28980000,&rdquo;efficiency&rdquo;:93,&rdquo;endTime&rdquo;:&rdquo;2020-10-12T09:34:30.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:31:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:600},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:41:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:60},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:42:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;deep&rdquo;,&rdquo;seconds&rdquo;:2340},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:63,&rdquo;thirtyDayAvgMinutes&rdquo;:59},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:27,&rdquo;minutes&rdquo;:257,&rdquo;thirtyDayAvgMinutes&rdquo;:364},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:5,&rdquo;minutes&rdquo;:94,&rdquo;thirtyDayAvgMinutes&rdquo;:58},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:24,&rdquo;minutes&rdquo;:69,&rdquo;thirtyDayAvgMinutes&rdquo;:95}}},&rdquo;logId&rdquo;:26589710673,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:415,&rdquo;minutesAwake&rdquo;:68,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-12T01:31:00.000&rdquo;,&rdquo;timeInBed&rdquo;:483,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:63,&rdquo;light&rdquo;:257,&rdquo;rem&rdquo;:94,&rdquo;wake&rdquo;:69},&rdquo;totalMinutesAsleep&rdquo;:415,&rdquo;totalSleepRecords&rdquo;:1,&rdquo;totalTimeInBed&rdquo;:483}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<details class="info"><summary>FITBIT_SLEEP_INTRADAY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>TIMESTAMP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>TYPE_EPISODE_ID</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DURATION</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>IS_MAIN_SLEEP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>TYPE</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>LEVEL</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_sleep_intraday_json.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Fitbit API has two versions for sleep data, v1 and v1.2, we support both.</p>
<p>All columns except <code>DEVICE_ID</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by Fitbit&rsquo;s API. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the expected raw data</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-10&rdquo;,&rdquo;duration&rdquo;:3600000,&rdquo;efficiency&rdquo;:92,&rdquo;endTime&rdquo;:&rdquo;2020-10-10T16:37:00.000&rdquo;,&rdquo;infoCode&rdquo;:2,&rdquo;isMainSleep&rdquo;:false,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:36:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;restless&rdquo;,&rdquo;seconds&rdquo;:60},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:37:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;asleep&rdquo;,&rdquo;seconds&rdquo;:660},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T15:48:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;restless&rdquo;,&rdquo;seconds&rdquo;:60},&hellip;], &ldquo;summary&rdquo;:{&ldquo;asleep&rdquo;:{&ldquo;count&rdquo;:0,&rdquo;minutes&rdquo;:56},&rdquo;awake&rdquo;:{&ldquo;count&rdquo;:0,&rdquo;minutes&rdquo;:0},&rdquo;restless&rdquo;:{&ldquo;count&rdquo;:3,&rdquo;minutes&rdquo;:4}}},&rdquo;logId&rdquo;:26315914306,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:55,&rdquo;minutesAwake&rdquo;:5,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-10T15:36:30.000&rdquo;,&rdquo;timeInBed&rdquo;:60,&rdquo;type&rdquo;:&rdquo;classic&rdquo;},{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-10&rdquo;,&rdquo;duration&rdquo;:22980000,&rdquo;efficiency&rdquo;:88,&rdquo;endTime&rdquo;:&rdquo;2020-10-10T08:10:00.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T01:46:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:420},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T01:53:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;deep&rdquo;,&rdquo;seconds&rdquo;:1230},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-10T02:14:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:360},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:3,&rdquo;minutes&rdquo;:92,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:29,&rdquo;minutes&rdquo;:193,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:33,&rdquo;thirtyDayAvgMinutes&rdquo;:0},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:28,&rdquo;minutes&rdquo;:65,&rdquo;thirtyDayAvgMinutes&rdquo;:0}}},&rdquo;logId&rdquo;:26311786557,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:318,&rdquo;minutesAwake&rdquo;:65,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-10T01:46:30.000&rdquo;,&rdquo;timeInBed&rdquo;:383,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:92,&rdquo;light&rdquo;:193,&rdquo;rem&rdquo;:33,&rdquo;wake&rdquo;:65},&rdquo;totalMinutesAsleep&rdquo;:373,&rdquo;totalSleepRecords&rdquo;:2,&rdquo;totalTimeInBed&rdquo;:443}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-11&rdquo;,&rdquo;duration&rdquo;:41640000,&rdquo;efficiency&rdquo;:89,&rdquo;endTime&rdquo;:&rdquo;2020-10-11T11:47:00.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:12:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:450},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:20:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:870},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-11T00:34:30.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:780},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:52,&rdquo;thirtyDayAvgMinutes&rdquo;:62},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:32,&rdquo;minutes&rdquo;:442,&rdquo;thirtyDayAvgMinutes&rdquo;:364},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:6,&rdquo;minutes&rdquo;:68,&rdquo;thirtyDayAvgMinutes&rdquo;:58},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:29,&rdquo;minutes&rdquo;:132,&rdquo;thirtyDayAvgMinutes&rdquo;:94}}},&rdquo;logId&rdquo;:26589710670,&rdquo;minutesAfterWakeup&rdquo;:1,&rdquo;minutesAsleep&rdquo;:562,&rdquo;minutesAwake&rdquo;:132,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-11T00:12:30.000&rdquo;,&rdquo;timeInBed&rdquo;:694,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:52,&rdquo;light&rdquo;:442,&rdquo;rem&rdquo;:68,&rdquo;wake&rdquo;:132},&rdquo;totalMinutesAsleep&rdquo;:562,&rdquo;totalSleepRecords&rdquo;:1,&rdquo;totalTimeInBed&rdquo;:694}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>{&ldquo;sleep&rdquo;:[{&ldquo;dateOfSleep&rdquo;:&rdquo;2020-10-12&rdquo;,&rdquo;duration&rdquo;:28980000,&rdquo;efficiency&rdquo;:93,&rdquo;endTime&rdquo;:&rdquo;2020-10-12T09:34:30.000&rdquo;,&rdquo;infoCode&rdquo;:0,&rdquo;isMainSleep&rdquo;:true,&rdquo;levels&rdquo;:{&ldquo;data&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:31:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;wake&rdquo;,&rdquo;seconds&rdquo;:600},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:41:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;light&rdquo;,&rdquo;seconds&rdquo;:60},{&ldquo;dateTime&rdquo;:&rdquo;2020-10-12T01:42:00.000&rdquo;,&rdquo;level&rdquo;:&rdquo;deep&rdquo;,&rdquo;seconds&rdquo;:2340},&hellip;], &ldquo;summary&rdquo;:{&ldquo;deep&rdquo;:{&ldquo;count&rdquo;:4,&rdquo;minutes&rdquo;:63,&rdquo;thirtyDayAvgMinutes&rdquo;:59},&rdquo;light&rdquo;:{&ldquo;count&rdquo;:27,&rdquo;minutes&rdquo;:257,&rdquo;thirtyDayAvgMinutes&rdquo;:364},&rdquo;rem&rdquo;:{&ldquo;count&rdquo;:5,&rdquo;minutes&rdquo;:94,&rdquo;thirtyDayAvgMinutes&rdquo;:58},&rdquo;wake&rdquo;:{&ldquo;count&rdquo;:24,&rdquo;minutes&rdquo;:69,&rdquo;thirtyDayAvgMinutes&rdquo;:95}}},&rdquo;logId&rdquo;:26589710673,&rdquo;minutesAfterWakeup&rdquo;:0,&rdquo;minutesAsleep&rdquo;:415,&rdquo;minutesAwake&rdquo;:68,&rdquo;minutesToFallAsleep&rdquo;:0,&rdquo;startTime&rdquo;:&rdquo;2020-10-12T01:31:00.000&rdquo;,&rdquo;timeInBed&rdquo;:483,&rdquo;type&rdquo;:&rdquo;stages&rdquo;}],&rdquo;summary&rdquo;:{&ldquo;stages&rdquo;:{&ldquo;deep&rdquo;:63,&rdquo;light&rdquo;:257,&rdquo;rem&rdquo;:94,&rdquo;wake&rdquo;:69},&rdquo;totalMinutesAsleep&rdquo;:415,&rdquo;totalSleepRecords&rdquo;:1,&rdquo;totalTimeInBed&rdquo;:483}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<details class="info"><summary>FITBIT_STEPS_SUMMARY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>TIMESTAMP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>STEPS</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_steps_summary_json.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code>TIMESTAMP</code>, <code>LOCAL_DATE_TIME</code>, and <code>STEPS</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by Fitbit&rsquo;s API. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the expected raw data</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-07&rdquo;,&rdquo;value&rdquo;:&rdquo;1775&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:5},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:3},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:0},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-08&rdquo;,&rdquo;value&rdquo;:&rdquo;3201&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:14},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:11},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:10},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-09&rdquo;,&rdquo;value&rdquo;:&rdquo;998&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:0},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:0},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:0},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<details class="info"><summary>FITBIT_STEPS_INTRADAY</summary><p><strong>RAPIDS_COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>RAPIDS column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>TIMESTAMP</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>DEVICE_ID</td>
<td>device_id</td>
</tr>
<tr>
<td>LOCAL_DATE_TIME</td>
<td>FLAG_TO_MUTATE</td>
</tr>
<tr>
<td>STEPS</td>
<td>FLAG_TO_MUTATE</td>
</tr>
</tbody>
</table>
<p><strong>MUTATION</strong></p>
<ul>
<li>
<p><strong>COLUMN_MAPPINGS</strong></p>
<table>
<thead>
<tr>
<th>Script column</th>
<th>Stream column</th>
</tr>
</thead>
<tbody>
<tr>
<td>JSON_FITBIT_COLUMN</td>
<td>fitbit_data</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>SCRIPTS</strong></p>
<div class="highlight"><pre><span></span><code>- src/data/streams/mutations/fitbit/parse_steps_intraday_json.py
- src/data/streams/mutations/fitbit/add_zero_timestamp.py
</code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code>TIMESTAMP</code>, <code>LOCAL_DATE_TIME</code>, and <code>STEPS</code> are parsed from <code>JSON_FITBIT_COLUMN</code>. <code>JSON_FITBIT_COLUMN</code> is a string column containing the JSON objects returned by <a href="https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-intraday-time-series">Fitbit&rsquo;s API</a>. See an example of the raw data RAPIDS expects for this data stream:</p>
<details class="example"><summary>Example of the expected raw data</summary><table>
<thead>
<tr>
<th>device_id</th>
<th>fitbit_data</th>
</tr>
</thead>
<tbody>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-07&rdquo;,&rdquo;value&rdquo;:&rdquo;1775&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:5},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:3},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:0},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-08&rdquo;,&rdquo;value&rdquo;:&rdquo;3201&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:14},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:11},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:10},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
<tr>
<td>a748ee1a-1d0b-4ae9-9074-279a2b6ba524</td>
<td>&ldquo;activities-steps&rdquo;:[{&ldquo;dateTime&rdquo;:&rdquo;2020-10-09&rdquo;,&rdquo;value&rdquo;:&rdquo;998&rdquo;}],&rdquo;activities-steps-intraday&rdquo;:{&ldquo;dataset&rdquo;:[{&ldquo;time&rdquo;:&rdquo;00:00:00&rdquo;,&rdquo;value&rdquo;:0},{&ldquo;time&rdquo;:&rdquo;00:01:00&rdquo;,&rdquo;value&rdquo;:0},{&ldquo;time&rdquo;:&rdquo;00:02:00&rdquo;,&rdquo;value&rdquo;:0},&hellip;],&rdquo;datasetInterval&rdquo;:1,&rdquo;datasetType&rdquo;:&rdquo;minute&rdquo;}}</td>
</tr>
</tbody>
</table>
</details>
</div>
</li>
</ul>
</details>
<!-- Add custom comment system integration here -->
<!-- Utterances integration -->
<h2 id="__comments">Comments</h2>
<script type="text/javascript">
var rapids_utterances_theme = false
document.onreadystatechange = function () {
if (document.readyState == "interactive") {
// wait for utterances to load and send it's first message.
addEventListener('message', event => {
if (event.origin !== 'https://utteranc.es' || rapids_utterances_theme == true) {
return;
}
rapids_utterances_theme = true
if(document.body.getAttribute("data-md-color-scheme") == "default")
document.querySelector("iframe.utterances-frame").contentWindow.postMessage({ type: "set-theme", theme: "github-light" },"https://utteranc.es/")
else
document.querySelector("iframe.utterances-frame").contentWindow.postMessage({ type: "set-theme", theme: "photon-dark" },"https://utteranc.es/")
});
document.getElementById('__palette_1').onclick = function(){
document.querySelector("iframe.utterances-frame").contentWindow.postMessage({ type: "set-theme", theme: "github-light" },"https://utteranc.es/")
}
document.getElementById('__palette_2').onclick = function(){
document.querySelector("iframe.utterances-frame").contentWindow.postMessage({ type: "set-theme", theme: "photon-dark" },"https://utteranc.es/")
}
}
}
</script>
<script src="https://utteranc.es/client.js"
repo="carissalow/rapids"
issue-term="pathname"
label="docs comments"
theme="github-light"
crossorigin="anonymous"
async>
</script>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<nav class="md-footer__inner md-grid" aria-label="Footer">
<a href="../fitbitjson-mysql/" class="md-footer__link md-footer__link--prev" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Previous
</span>
fitbitjson_mysql
</div>
</div>
</a>
<a href="../fitbitparsed-mysql/" class="md-footer__link md-footer__link--next" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
fitbitparsed_mysql
</div>
</div>
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
Released under AGPL
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs Insiders
</a>
</div>
<div class="md-footer-social">
<a href="https://twitter.com/RAPIDS_Science" target="_blank" rel="noopener" title="twitter.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.sections", "search.suggest", "search.highlight"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../assets/javascripts/workers/search.df8cae7d.min.js", "version": {"provider": "mike"}}</script>
<script src="../../assets/javascripts/bundle.0c4ae912.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</body>
</html>