Nightscout#2
Merged
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).