Skip to content

intraday: JSON keys do not match CSV headers (rmssd vs hrv_rmssd, duration vs duration_sec, etc.) #20

Open

Description

@DTTerastar

Severity

minor

Summary

For the intraday subcommand, JSON keys and CSV headers describe the same fields with different names, and JSON also drops the datetime column entirely. Cross-format consumers have to maintain two name maps.

Reproduce

$ withings-export intraday --since 1d | head -1
timestamp,datetime,duration_sec,steps,distance_m,elevation_m,calories,heart_rate,hrv_rmssd,hrv_sdnn1,hrv_quality,spo2_auto,model,model_id

$ withings-export intraday --since 1d --json | jq '.[0] | keys'
[
  "calories", "distance", "duration", "elevation", "heart_rate",
  "hrv_quality", "model", "model_id", "rmssd", "sdnn1",
  "spo2_auto", "steps", "timestamp"
]

Mismatches:

CSV JSON
duration_sec duration
distance_m distance
elevation_m elevation
hrv_rmssd rmssd
hrv_sdnn1 sdnn1
datetime (missing)

Other subcommands (activity, workouts, measurements) keep names roughly aligned, so intraday is the odd one out.

Expected

Either:

  • Pick one canonical name per field and use it in both serializers (preferred — heart_rate / hrv_rmssd / duration_sec-style snake_case with units), or
  • Document the mapping in prime and the README.

Notes

The unit-suffixed CSV names (_sec, _m) are useful in spreadsheets; matching them in JSON is fine. The bigger ask is hrv_rmssd ↔ rmssd and the missing datetime in JSON.

Activity

  1. DTTerastar commented on Apr 25, 2026

    @DTTerastar
    ContributorAuthor

    Confirmed still reproduces against HEAD b580683: same JSON keys (duration, distance, elevation, rmssd, sdnn1, no datetime) vs CSV headers (duration_sec, distance_m, elevation_m, hrv_rmssd, hrv_sdnn1, datetime). Note: workouts and activity exhibit similar (smaller) drift — see new bug filed for those.

  2. added
    kind:bugObserved behavior diverges from documented behavior.
    area:format--format markdown/json/csv and codec behavior.
    priority:mediumReproducible bug or gap with a workaround, or a well-scoped enhancement clearly in charter.
    on May 19, 2026
  3. Terastar-Paperclip commented on May 19, 2026

    @Terastar-Paperclip
    Contributor

    Thanks — the side-by-side head -1 / jq keys repro and the mapping table make this easy to triage.

    Triage: kind:bug · area:format · priority:medium per TRIAGE.md. Cross-format schema drift on a documented surface, with a workaround (downstream rename map), but real friction for any consumer mixing CSV and JSON. Sibling of #27 (same class of drift on workouts).

    Routing: Lead Go Engineer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:format--format markdown/json/csv and codec behavior.kind:bugObserved behavior diverges from documented behavior.priority:mediumReproducible bug or gap with a workaround, or a well-scoped enhancement clearly in charter.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions