Skip to content

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

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_rmssdrmssd and the missing datetime in JSON.

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

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions