Skip to content

Nightscout#2

Merged
winternewt merged 4 commits into
GlucoseDAO:mainfrom
antonkulaga:nightscout
Apr 7, 2026
Merged

Nightscout#2
winternewt merged 4 commits into
GlucoseDAO:mainfrom
antonkulaga:nightscout

Conversation

@antonkulaga

Copy link
Copy Markdown
Member

based on previos medtronics branch. Adds nightscout, also reorganizes readme, agents.md and docs. Also I had to change the threshold to fit to what we have in glucose_processing lib (15 mins).

winternewt and others added 2 commits April 5, 2026 22:20
- Add Nightscout constants to formats/__init__.py exports (matching
  Dexcom/Libre/Medtronic pattern)
- Split _is_nightscout_json into _is_nightscout_entries_json and
  _is_nightscout_treatments_json for correct type-specific detection
- Replace hardcoded test file paths in test_nightscout.py with
  format-detection-based discovery (skip gracefully when no data)
- Replace all hardcoded gap/interval values in tests with
  SMALL_GAP_MAX_MINUTES and EXPECTED_INTERVAL_MINUTES constants
  so tests pass regardless of threshold configuration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…CSV support, add api_secret auth

The Nightscout API /entries.csv endpoint is headerless (5 cols only) and
/treatments.csv returns JSON regardless. Drop both; support the
nightscout-exporter community tool's combined CSV format instead (with
# CGM ENTRIES / # TREATMENTS section headers).

- Downloader: JSON-only (entries + treatments + profile), add api_secret
  (SHA1-hashed api-secret header) alongside existing token auth
- Parser: new from_nightscout_exports() and from_nightscout_url() public
  APIs; split JSON and CSV internal paths cleanly; locale-aware datetime
  parsing for exporter CSV
- Schema: matches nightscout-exporter column layout (Date, Time,
  Glucose (mg/dL), Type, Device, Trend, ID)
- Detection: patterns target exporter CSV; JSON no longer goes through
  detect_format (use from_nightscout_exports/parse_nightscout instead)
- Tests: 32 nightscout tests (JSON API, exporter CSV, exports API,
  roundtrip, pipeline); 933 total pass
- CLI: removed --format, added --api-secret

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@winternewt winternewt merged commit 6df3787 into GlucoseDAO:main Apr 7, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants