Code Monkey home page Code Monkey logo

cycle-plotter's Introduction

Cycle Plotter

GitHub Actions Workflow Status GitHub License GitHub top language GitHub last commit

This command-line tool reads data from an Apple Health or Withings Health Mate export, and creates a plot of cycle durations.

On the x-axis, we have the date at the beginning of a cycle.

On the y-axis, we have the duration of the cycle. The duration of a cycle is the number of days between its start, and the start of the next cycle.

Sample graphs

The datasets for these graphs were generated by ChatGPT. They don't corespond to any real person.

Regular cycles

Cycles covering a period of 6 months, with little variation in cycle length.

Pregnancy

Cycles covering a period of just over one year, with a pregnancy during that time.

--axis x --axis y --axis both (default)

Usage

Run the program with the --help argument to see the full usage.

% python -m cycleplotter.main --help
usage: main.py [-h] -i INPUT_FILE -o OUTPUT_FILE -s {apple,withings} [-a {x,y,both}] [-d DIMENSIONS]

options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input-file INPUT_FILE
                        path to archive exported from
                        Apple Health or Withings Health Mate
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        path to image file to export
  -s {apple,withings}, --source {apple,withings}
  -a {x,y,both}, --axis {x,y,both}
                        Indicate the cycle durations on:

                        x: the x-axis, by horizontal spacing between points
                        y: the y-axis, by their values
                        both: both axes

                        Default both.
  -d DIMENSIONS, --dimensions DIMENSIONS
                        The size of the image to create.

                        Supported values are:
                          a4
                          letter
                          <width>x<height><unit>

                        Supported units are in, cm, and px.

                        Example: 600x400px

                        Default a4.

The program has been tested exporting to png and pdf. But other formats are probably supported. The program uses matplotlib to output the image. The supported file formats may be in the matplotlib documentation.

Examples:

Export a png of data from Apple Health, using long arguments:

python -m cycleplotter.main --input-file ~/Downloads/export.zip  --output-file /tmp/cyclegraph.png --source apple

Export a pdf of data from Withings Health Mate, using short arguments:

python -m cycleplotter.main -i ~/Downloads/data_ABC_1717249954.zip  -o /tmp/cyclegraph.pdf -s withings

How to get the health data files

See the steps here.

cycle-plotter's People

Contributors

caarmen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.