Giter VIP home page Giter VIP logo

dexcom_share_api-ruby's Introduction

TLDR; This is a tiny gem to interact with the Dexcom Share API. The API is (unfortunately) private, so any implementation can't really have stability guarantees. However, it hasn't changed for the past few years so it should be fairly stable. Feel free to report any bugs and I'll fix them!

https://rubygems.org/gems/dexcom_share_api

Usage

require "dexcom_share_api"

# Create a client with your username and password from Dexcom Share.
# If you get authentication issues, try to confirm your username/password by
# logging into Dexcom Share directly.
client = DexcomShareApi.create_client(
  username: "Dexcom share username",
  password: "Dexcom share password",
  # If your account is registered in the US, otherwise `outside-us`.
  server: "us",
)

# Defaults to outputting the last 10 entries
# Optionally can pass in the _last_ parameter.
# ```
#   client.estimated_glucose(last: 5)
# ```
glucose = client.estimated_glucose
glucose.each do |entry|
  puts entry.mmol # => 5.39
  puts entry.mgdl # => 151.0
  puts entry.trend # => "flat"
  puts entry.trend_arrow # => "→"
  # Timestamp is an iso8601
  puts entry.timestamp # => "2024-03-06T04:14:53+00:00"
end

# Alternatively, to grab the last entry:
glucose = client.last_estimated_glucose
puts glucose.to_h # => {:trend=>"flat", :trend_arrow=>"→", :timestamp=>"2024-03-06T04:14:53+00:00", :mmol=>8.39, :mgdl=>151.0}

History

I originally made this library in JavaScript many years ago to enable some watch-face development. Recently I had a use-case where I wanted to store a bunch of Dexcom data in a database for some offline analysis, and decided I'd port it to Ruby to make that process more enjoyable.

Development

To test:

  • bin/test

To build:

  • gem build && gem install dexcom_share_api

dexcom_share_api-ruby's People

Contributors

aud avatar

Watchers

 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.