Skip to content

Tools for accessing data from the DEXCOM Share API and acting on it

License

Notifications You must be signed in to change notification settings

jerm/dexcom_tools

Repository files navigation

Credit

This started as a python rewrite/rework of much of the DexcomShare portion of share2nightscount, a dexcom reporting piece of the most excellent NightScout project. I've skipped all the NS integration as I'm not using NightScout, though it should be easy enough to reimplement, if you like.

Description

(Paraphrased and updated from the share2nightscout description) The program logs in to Dexcom Share as the data publisher. It re-uses the token every 2.5 minutes to fetch the latest glucose record. This information is then sent to the terminal and DataDog, making the data available to whomever the owner chooses. It will continue to re-use the same sessionID until it expires, at which point it should attempt to log in again. If it can log in again, it will continue to re-use the new token to fetch data.

So that we don't report duplicate values, readings are only sent to datadog if the timestamp has advanced.

Datadog

I chose datadog because it has a great stat visualizing interface, can do alerting, and is free. Set up an account, an api and app key, put the values into the ini file, and datadog will graph things for you

Webapp

In order to make this easily query-able from... other things... I've added webapp.py and webapp.ini.example to make the readings available via a "serverless" web endpoint using flask and zappa.io. Follow steps on zappa.io page to deploy.

Example: example datadog graph

Installation

clone the repo

$ cd dexcom_tools

$ pip install --user -r requirements.txt

$ cp dexcom_tools.ini.example dexcom_tools.ini

Edit dexcom_tools.ini

Put in your dexcom share (and any other ) credentials change stat_name to something sensical, ie: jeremy.bg

Usage

$ python dexcom_tools.py

#Test your setup

Start the dev server

./webapp.py

Send a sample query

curl http://localhost:5000/dexcom/5l5l5l5l4k4k4j3h3h3h22j2 --data-binary @example-request.json

TODO

Better docs for webapp/lamba deploy

Portable desktop alerts

slack/sms/etc.. alerts

About

Tools for accessing data from the DEXCOM Share API and acting on it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages