{"id":19336804,"url":"https://github.com/samrocketman/babytime-reporter","last_synced_at":"2026-06-29T03:31:16.395Z","repository":{"id":145441793,"uuid":"367779528","full_name":"samrocketman/babytime-reporter","owner":"samrocketman","description":"Turn a BabyTime app data export into JSON time series data for rich dashboards in Grafana.","archived":false,"fork":false,"pushed_at":"2021-06-11T22:15:19.000Z","size":326,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-06T08:24:57.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samrocketman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-16T03:50:33.000Z","updated_at":"2022-10-26T06:05:32.000Z","dependencies_parsed_at":"2023-07-02T23:45:59.748Z","dependency_job_id":null,"html_url":"https://github.com/samrocketman/babytime-reporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samrocketman/babytime-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fbabytime-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fbabytime-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fbabytime-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fbabytime-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samrocketman","download_url":"https://codeload.github.com/samrocketman/babytime-reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fbabytime-reporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34912252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:12:29.068Z","updated_at":"2026-06-29T03:31:16.377Z","avatar_url":"https://github.com/samrocketman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get Richer Data from BabyTime\n\nOriginally, this repository was going to be for Baby Tracker app.  However, it\ndoesn't support data sync between parents.  So my wife and I decided to use the\nBabyTime app for data sync between us.  BabyTime has rich stats and metrics\nalready so it doesn't _need_ a Grafana dashboard... but I wanted one.\n\n[BabyTime][1] is a newborn tracking app for breastfeeding, breast pumping, and\nfeeding your baby from the breast, pumped milk, or formula.  This processes data\nand puts it into InfluxDB where richer reports can be generated using Grafana.\n\nThe following are supported tags for richer metrics on _Pumped Milk_ and\n_Formula_ feeding events:\n\n- Purple Nipple\n- Spit Up\n- Yellow Nipple\n\nThe app also supports a generic `Etc` field which can contain custom baby\nevents.  Since babies may have a tongue tie surgery, one must do `tongue\nlift` exercises on the baby's tongue.  The following custom `Etc` events are\nsupported.\n\n- Spit Up\n- tongue lift\n\nSometimes a baby might spit up far later than a feeding.  So it makes sense to\ntrack it with an Etc event in addition to bottle feeding.\n\n# Bottle Flow\n\nThe purple and yellow bottle nipples control how much flow a baby consumes while\nfeeding from a bottle.\n\nFlow in order of fastest to slowest.\n\n- Yellow Nipple\n- Purple Nipple\n\n# Provisioning InfluxDB\n\nThis assumes you've provisioned InfluxDB on a local Vault and Consul cluster\nusing Docker.\n\nProvision the following projects in order:\n\n- [Consul][2]\n- [InfluxDB][3]\n- [Kapacitor][4]\n- [Chronograf][5]\n- [Grafana][6]\n\nThen, [configure your browser to browse the cluster web page][cluster-web] and\nvisit the address `http://portal.service.consul/grafana/`.\n\n# Uploading stats to InfluxDB\n\n1. From the app, go to _BabyTime Settings_, _Export (Download)_, _Daily Record\n   (txt)_, and all of your records by emailing to yourself.\n2. Download the activity zip file into the root of this repository.\n3. Upload all data into InfluxDB by running the following command.\n   ```bash\n   make\n\n   # alternate command if you want to force a custom timezone\n   make TZ=UTC\n   ```\n\nAlternately, if you only want to create the `babytime-data.json` file, then run\nthe following command.\n\n    make babytime-data.json\n\nAlternately, if you want to force the timezone to be something other than your\nsystem timezone, then run the following command.\n\n    make TZ=UTC babytime-data.json\n\n`babytime-data.json` is the daily record converted into a time-series JSON\narray.  The JSON array is unsorted, but each JSON Object has a `time` key which\nnotes at what time an `event` occurred.\n\n# Create the dashboard\n\nLog into Grafana by visiting `http://portal.service.consul/grafana/` with\nusername `admin` and password `admin`.  It will prompt you to change the\npassword.\n\nImport [the dashboard from this repository][dashboard-json].  If you've already\npublished your BabyTime data, then you should see some graphed metrics which you\ncan change the time period.\n\nUpdate the dashboard to your liking.\n\n# Screenshots\n\n### 24h Data View\n\n![24h view of feeding and breast pumping][24h-view]\n\n### 7d Data View\n\n![7d view of feeding volume, spit up events, and breast feeding time][7d-view]\n\n# Data conversion\n\nThe following is a sample of BabyTime data exported from its app.\n\n\u003cdetails\u003e\u003csummary\u003eData sample exported from BabyTime (Click to expand)\u003c/summary\u003e\n\n---\n\n```\nYYYY-MM-DD 04:47 PM\nType: Pumped Milk\nPumped Milk Total Amount(ml): 77 (ml)\nMemo: Yellow Nipple\n====================\nYYYY-MM-DD 04:23 PM ~ YYYY-MM-DD 04:45 PM\nType: Breastfeeding (right)\nDuration: 22 (min)\nBreastfeeding Right: 22 (min)\nMemo: Shield, let down\n====================\nYYYY-MM-DD 04:15 PM\nType: Pee\nDiaper type: Pee\n====================\nYYYY-MM-DD 02:30 PM\nType: Pee\nDiaper type: Both\n====================\nYYYY-MM-DD 01:55 PM\nType: Pumped Milk\nPumped Milk Total Amount(ml): 65 (ml)\nMemo: Purple Nipple\n====================\nYYYY-MM-DD 01:30 PM ~ YYYY-MM-DD 01:50 PM\nType: Breastfeeding (right)\nDuration: 20 (min)\nBreastfeeding Right: 20 (min)\nMemo: Shield\n====================\nYYYY-MM-DD 12:15 PM ~ YYYY-MM-DD 12:30 PM\nType: Pumping\nDuration: 15 (min)\nPumping Left: 14 (min)\nPumping Right: 15 (min)\nPumping Total Amount(ml): 32 (ml)\nPumping Left Amount(ml): 15 (ml)\nPumping Right Amount(ml): 17 (ml)\nMemo: Bottle Fed\n====================\n```\n\n\u003c/details\u003e\n\n---\n\nI converted the raw export data into JSON array time series data which is\ningested and published to InfluxDB.  Grafana is then used to create a dashboard\nwhich answers questions our pediatrician or lactician asks about.\n\n\u003cdetails\u003e\u003csummary\u003eBabyTime converted to JSON time series (Click to expand)\u003c/summary\u003e\n\n---\n\n```json\n[\n    {\n        \"event\": \"Feed Pumped Milk\",\n        \"feed_pump_ml\": 77,\n        \"notes\": \"Yellow Nipple\",\n        \"time\": \"YYYY-MM-DD 04:47 PM EDT\",\n        \"yellow_nipple\": true\n    },\n    {\n        \"duration_min\": 22,\n        \"event\": \"Breastfeeding\",\n        \"feed_breast_right_min\": 22,\n        \"notes\": \"Shield, let down\",\n        \"time\": \"YYYY-MM-DD 04:23 PM EDT\"\n    },\n    {\n        \"diaper_type\": \"Pee\",\n        \"event\": \"Change Diaper\",\n        \"pee\": true,\n        \"time\": \"YYYY-MM-DD 04:15 PM EDT\"\n    },\n    {\n        \"diaper_type\": \"Both\",\n        \"event\": \"Change Diaper\",\n        \"pee\": true,\n        \"poop\": true,\n        \"time\": \"YYYY-MM-DD 02:30 PM EDT\"\n    },\n    {\n        \"event\": \"Feed Pumped Milk\",\n        \"feed_pump_ml\": 65,\n        \"notes\": \"Purple Nipple\",\n        \"purple_nipple\": true,\n        \"time\": \"YYYY-MM-DD 01:55 PM EDT\"\n    },\n    {\n        \"duration_min\": 20,\n        \"event\": \"Breastfeeding\",\n        \"feed_breast_right_min\": 20,\n        \"notes\": \"Shield\",\n        \"time\": \"YYYY-MM-DD 01:30 PM EDT\"\n    },\n    {\n        \"duration_min\": 15,\n        \"event\": \"Pumping\",\n        \"notes\": \"Bottle Fed\",\n        \"pump_left_breast_min\": 14,\n        \"pump_left_breast_ml\": 15,\n        \"pump_right_breast_min\": 15,\n        \"pump_right_breast_ml\": 17,\n        \"pump_total_ml\": 32,\n        \"time\": \"YYYY-MM-DD 12:15 PM EDT\"\n    }\n]\n```\n\n\u003c/details\u003e\n\n---\n\n[1]: https://www.babytime.care/\n[2]: https://github.com/samrocketman/docker-compose-ha-consul-vault-ui\n[3]: https://github.com/samrocketman/consul-influxdb\n[4]: https://github.com/samrocketman/consul-kapacitor\n[5]: https://github.com/samrocketman/consul-chronograf\n[6]: https://github.com/samrocketman/consul-grafana\n[24h-view]: ./dashboards/grafana/24h-data-view.png\n[7d-view]: ./dashboards/grafana/7d-data-view.png\n[cluster-web]: https://github.com/samrocketman/docker-compose-ha-consul-vault-ui#configure-your-browser\n[dashboard-json]: ./dashboards/grafana/BabyTime.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocketman%2Fbabytime-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamrocketman%2Fbabytime-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocketman%2Fbabytime-reporter/lists"}