Skip to main content

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)

Metadata

Release files for python-nightscout 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-nightscout 1.0.0
File Size Uploaded Provenance Actions
python-nightscout-1.0.0.tar.gz 7.5 kB Without provenance Details for python-nightscout-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-nightscout 1.0.0
File Interpreter ABI Platform Actions
python_nightscout-1.0.0-py3-none-any.whl Python 3 none any Details for python_nightscout-1.0.0-py3-none-any.whl

Total release size: 14.4 kB

Release files / python-nightscout-1.0.0.tar.gz

Download URL python-nightscout-1.0.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7326cd1a57992597a1e64eaa210e67fc273f7b8097bbdf500ae7e830347ce824
BLAKE2b-256 checksum
How to use checksums
67c7d3e5e9479eb00f83ed452fb6bd8a7d609e549c1b2b2f462f821d8f5dacbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / python_nightscout-1.0.0-py3-none-any.whl

Download URL python_nightscout-1.0.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
024dce2007e04d2e34fceab595b51ac0deff8a45cf838db0512095706610c18b
BLAKE2b-256 checksum
How to use checksums
38d7abf4f6277f6e76f2b5acc42e99552d55edc19c1915df52252d0b4d4b727c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Security for python-nightscout 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page