New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

python-nightscout

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-nightscout

A library that provides a Python interface to Nightscout

  • 1.0.0
  • PyPI
  • Socket score

Maintainers
1

Python Nightscout client

Build Status

A simple python client for accessing data stored in Nightscout

Example Usage

To create an instance of the nightscout.Api class, with no authentication:

import nightscout
api = nightscout.Api('https://yournightscoutsite.herokuapp.com')

To use authentication, instantiate the nightscout.Api class with your api secret:

api = nightscout.Api('https://yournightscoutsite.herokuapp.com', api_secret='your api secret')

Glucose Values

To fetch recent sensor glucose values (SGVs):

entries = api.get_sgvs()
print([entry.sgv for entry in entries])

Specify time ranges:

api.get_sgvs({'count':0, 'find[dateString][$gte]': '2017-03-07T01:10:26.000Z'})

Treatments

To fetch recent treatments (boluses, temp basals):

treatments = api.get_treatments()
print([treatment.eventType for treatment in treatments])

Profiles

profile_definition_set = api.get_profiles()

profile_definition = profile_definition_set.get_profile_definition_active_at(datetime.now())

profile = profile_definition.get_default_profile()

print "Duration of insulin action = %d" % profile.dia

five_thirty_pm = datetime(2017, 3, 24, 17, 30)
five_thirty_pm = profile.timezone.localize(five_thirty_pm)
print "Scheduled basal rate at 5:30pm is = %f" % profile.basal.value_at_date(five_thirty_pm)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc