September 11, 2026

Swift vibing my weight chart

I do have a Withings’ Body+ scale that I use to track my weight, and I have written in the past a simple Python webapp, that talks OAuth2 + API calls with Withings servers to grab my data and display it using matplotlib. It uses pandas to gather some insights, calculate moving average, global trends and yearly trends, draw these + a colored scaled BMI. Data is stored locally in a csv file, new data from Withings is prepended in the csv, no sqlite, no nothing. Simple stuff.

It works well, but I do have to remember to run it, sometimes I forget in which directory of my source code it is stored. I tinkered the code a lot, I would say it took me multiple days to have something I like, the code is not super great, I have commented portions, hardcoded keys, etc.

Yesterday I was bored because of the exact same scenario, where’s my python script again? I asked GPT-5.6 Sol to convert this in a native macOS application using Swift UI. This was a simple Python script (600 lines including the HTML to render the page), of course GPT one-shotted it.

In less than 15 minutes, it just worked fine. I then spent 15 minutes chatting with my AI friend to polish it and make it a little bit better for my eyes, and another 15-20 minutes to have better insights.

Better than what I would have produced myself in multiple days of work full-time, simply because I would have to spend hours on the Swift doc just for the charts, cause I practically never used it, and compared to matplotlib I know nothing about it.

Now I have a native macOS application that sits in my dock, the refresh with withings works smoothly, it’s fantastic. I may extend it with body fat and other metrics that the Withings scale is registering, maybe for another afternoon when I am bored.

I generated a sample weight data file (GPT made a script for that) in order to show you how it looks.

Features

  • Weight chart (raw measurements, moving average, global and yearly trend lines, BMI zones, max/min/latest weight)
  • Multiple time ranges support (all data, last week/month, year to date, etc.)
  • Mini-map for quickly selecting and zooming into periods.
  • Rich hover tooltips.
  • Dashboard metrics for current weight, goal progress, max/min weight, and differential from the visible-period maximum.
  • Insights (weekly trend, projected goal date when available, distance to goal, amplitude, etc.)
  • Display of all major weight-loss and regain phases.
  • Sync recent measurements from Withings.
  • CSV quality tools to detect outliers, suspicious jumps, duplicates, future dates, and long gaps.
alex@mac balance % cloc --exclude-ext=csv,yaml,md .
      60 text files.
      26 unique files.
    2639 files ignored.

github.com/AlDanial/cloc v 2.08  T=0.11 s (230.4 files/s, 41239.1 lines/s)
---------------------------------------------------------------------------
Language                 files          blank        comment           code
---------------------------------------------------------------------------
Swift                        9            308              3           2435
JSON                         7             21              0            830
Python                       2            124            280            380
XML                          6              0              0            205
Bourne Shell                 2             11              0             57
---------------------------------------------------------------------------
SUM:                        26            464            283           3907
---------------------------------------------------------------------------

Until next time!