{"id":17449146,"url":"https://github.com/ps2/python-nightscout","last_synced_at":"2025-04-19T14:53:45.483Z","repository":{"id":54555897,"uuid":"83980826","full_name":"ps2/python-nightscout","owner":"ps2","description":"Nightscout api client for python","archived":false,"fork":false,"pushed_at":"2023-10-20T21:11:39.000Z","size":18,"stargazers_count":27,"open_issues_count":0,"forks_count":27,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T09:01:52.037Z","etag":null,"topics":["nightscout","python","python-client","python-nightscout"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ps2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-05T15:31:46.000Z","updated_at":"2025-02-18T05:56:12.000Z","dependencies_parsed_at":"2024-10-20T01:34:38.363Z","dependency_job_id":"f09051f6-9094-4296-8f1a-bfbfbdc9d1d1","html_url":"https://github.com/ps2/python-nightscout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ps2%2Fpython-nightscout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ps2%2Fpython-nightscout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ps2%2Fpython-nightscout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ps2%2Fpython-nightscout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ps2","download_url":"https://codeload.github.com/ps2/python-nightscout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670508,"owners_count":21142897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nightscout","python","python-client","python-nightscout"],"created_at":"2024-10-17T21:05:12.177Z","updated_at":"2025-04-19T14:53:45.463Z","avatar_url":"https://github.com/ps2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Nightscout client\n\n[![Build Status](https://travis-ci.org/ps2/python-nightscout.svg?branch=master)](https://travis-ci.org/ps2/python-nightscout)\n\nA simple python client for accessing data stored in [Nightscout](https://github.com/nightscout/cgm-remote-monitor)\n\n## Install\n\nClone this repo, and inside the main directory, run:\n\n```\npip install .\n```\n\n\n## Example Usage\n\nTo create an instance of the nightscout.Api class, with no authentication:\n\n\timport nightscout\n    api = nightscout.Api('https://yournightscoutsite.herokuapp.com/')\n\nTo use authentication, instantiate the nightscout.Api class with your\n    api secret:\n\n\tapi = nightscout.Api('https://yournightscoutsite.herokuapp.com/', api_secret='your api secret')\n\n### Glucose Values\nTo fetch recent sensor glucose values (SGVs):\n\n\tentries = api.get_sgvs()\n\tprint([entry.sgv for entry in entries])\n\nSpecify time ranges:\n\n\tapi.get_sgvs({'count':0, 'find[dateString][$gte]': '2017-03-07T01:10:26.000Z'})\n\n### Treatments\nTo fetch recent treatments (boluses, temp basals):\n\n\ttreatments = api.get_treatments()\n\tprint([treatment.eventType for treatment in treatments])\n\n### Profiles\n\n\tprofile_definition_set = api.get_profiles()\n\n\tprofile_definition = profile_definition_set.get_profile_definition_active_at(datetime.now())\n\n\tprofile = profile_definition.get_default_profile()\n\n\tprint \"Duration of insulin action = %d\" % profile.dia\n\n\tfive_thirty_pm = datetime(2017, 3, 24, 17, 30)\n\tfive_thirty_pm = profile.timezone.localize(five_thirty_pm)\n\tprint \"Scheduled basal rate at 5:30pm is = %f\" % profile.basal.value_at_date(five_thirty_pm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fps2%2Fpython-nightscout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fps2%2Fpython-nightscout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fps2%2Fpython-nightscout/lists"}