cycle-plotter


Namecycle-plotter JSON
Version 0.0.1rc2 PyPI version JSON
download
home_pageNone
SummaryCommand line tool to plot a graph of cycles exported from Apple Health or Withings Health Mate.
upload_time2024-06-02 22:47:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 Carmen Alvarez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cli health
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Cycle Plotter

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/caarmen/cycle-plotter/check.yml)
![GitHub License](https://img.shields.io/github/license/caarmen/cycle-plotter)
![GitHub top language](https://img.shields.io/github/languages/top/caarmen/cycle-plotter)
![GitHub last commit](https://img.shields.io/github/last-commit/caarmen/cycle-plotter)

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.
<img src="https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/regular.png" >

#### Pregnancy
Cycles covering a period of just over one year, with a pregnancy during that time.
|`--axis x` | `--axis y` | `--axis both` (default) |
|---|---|---|
|<img src="https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-x.png" > |<img src="https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-y.png" > |<img src="https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-both.png" >|

## 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](https://matplotlib.org/stable/api/backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase.filetypes).

Examples:


Export a png of data from Apple Health, using long arguments:
```shell
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:
```shell
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](https://github.com/caarmen/cycle-plotter/blob/main/docs/healthdatafiles.md).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cycle-plotter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "cli, health",
    "author": null,
    "author_email": "Carmen Alvarez <carmen@rmen.ca>",
    "download_url": "https://files.pythonhosted.org/packages/08/fd/f9f862d093e5d4148d6ae47594bb1ee6f0cbb42948e0f9780d027bf0b51e/cycle_plotter-0.0.1rc2.tar.gz",
    "platform": null,
    "description": "## Cycle Plotter\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/caarmen/cycle-plotter/check.yml)\n![GitHub License](https://img.shields.io/github/license/caarmen/cycle-plotter)\n![GitHub top language](https://img.shields.io/github/languages/top/caarmen/cycle-plotter)\n![GitHub last commit](https://img.shields.io/github/last-commit/caarmen/cycle-plotter)\n\nThis command-line tool reads data from an Apple Health or Withings Health Mate export, and creates a plot of cycle durations.\n\nOn the x-axis, we have the date at the beginning of a cycle.\n\nOn 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.\n\n### Sample graphs\n\nThe datasets for these graphs were generated by ChatGPT. They don't corespond to any real person.\n\n#### Regular cycles\nCycles covering a period of 6 months, with little variation in cycle length.\n<img src=\"https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/regular.png\" >\n\n#### Pregnancy\nCycles covering a period of just over one year, with a pregnancy during that time.\n|`--axis x` | `--axis y` | `--axis both` (default) |\n|---|---|---|\n|<img src=\"https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-x.png\" > |<img src=\"https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-y.png\" > |<img src=\"https://raw.githubusercontent.com/caarmen/cycle-plotter/main/docs/pregnancy-both.png\" >|\n\n## Usage\n\nRun the program with the `--help` argument to see the full usage.\n\n```\n% python -m cycleplotter.main --help\nusage: main.py [-h] -i INPUT_FILE -o OUTPUT_FILE -s {apple,withings} [-a {x,y,both}] [-d DIMENSIONS]\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUT_FILE, --input-file INPUT_FILE\n                        path to archive exported from\n                        Apple Health or Withings Health Mate\n  -o OUTPUT_FILE, --output-file OUTPUT_FILE\n                        path to image file to export\n  -s {apple,withings}, --source {apple,withings}\n  -a {x,y,both}, --axis {x,y,both}\n                        Indicate the cycle durations on:\n\n                        x: the x-axis, by horizontal spacing between points\n                        y: the y-axis, by their values\n                        both: both axes\n\n                        Default both.\n  -d DIMENSIONS, --dimensions DIMENSIONS\n                        The size of the image to create.\n\n                        Supported values are:\n                          a4\n                          letter\n                          <width>x<height><unit>\n\n                        Supported units are in, cm, and px.\n\n                        Example: 600x400px\n\n                        Default a4.\n```\n\nThe 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](https://matplotlib.org/stable/api/backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase.filetypes).\n\nExamples:\n\n\nExport a png of data from Apple Health, using long arguments:\n```shell\npython -m cycleplotter.main --input-file ~/Downloads/export.zip  --output-file /tmp/cyclegraph.png --source apple\n```\n\nExport a pdf of data from Withings Health Mate, using short arguments:\n```shell\npython -m cycleplotter.main -i ~/Downloads/data_ABC_1717249954.zip  -o /tmp/cyclegraph.pdf -s withings\n```\n\n## How to get the health data files\n\nSee the steps [here](https://github.com/caarmen/cycle-plotter/blob/main/docs/healthdatafiles.md).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Carmen Alvarez  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Command line tool to plot a graph of cycles exported from Apple Health or Withings Health Mate.",
    "version": "0.0.1rc2",
    "project_urls": {
        "Changelog": "https://github.com/caarmen/cycle-plotter/releases",
        "Repository": "https://github.com/caarmen/cycle-plotter"
    },
    "split_keywords": [
        "cli",
        " health"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2847b1bad780cef21ffb578adbb987ede40c6895001a0bd1004d5a4e08e097d",
                "md5": "42b257c46a43a2736ec46f7681e7901a",
                "sha256": "7d343831cbf5c5b13aaa2e5a4c00d99554d40b052c7586b9f012226be5f80276"
            },
            "downloads": -1,
            "filename": "cycle_plotter-0.0.1rc2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42b257c46a43a2736ec46f7681e7901a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 14112,
            "upload_time": "2024-06-02T22:47:50",
            "upload_time_iso_8601": "2024-06-02T22:47:50.847768Z",
            "url": "https://files.pythonhosted.org/packages/b2/84/7b1bad780cef21ffb578adbb987ede40c6895001a0bd1004d5a4e08e097d/cycle_plotter-0.0.1rc2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08fdf9f862d093e5d4148d6ae47594bb1ee6f0cbb42948e0f9780d027bf0b51e",
                "md5": "66f13bb50b415b34d8b4fa65a1928b8e",
                "sha256": "964cb619150fd9826395568b4681ae49be7c445a9a62a23006444bade4e67fe2"
            },
            "downloads": -1,
            "filename": "cycle_plotter-0.0.1rc2.tar.gz",
            "has_sig": false,
            "md5_digest": "66f13bb50b415b34d8b4fa65a1928b8e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 9702,
            "upload_time": "2024-06-02T22:47:52",
            "upload_time_iso_8601": "2024-06-02T22:47:52.428594Z",
            "url": "https://files.pythonhosted.org/packages/08/fd/f9f862d093e5d4148d6ae47594bb1ee6f0cbb42948e0f9780d027bf0b51e/cycle_plotter-0.0.1rc2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-02 22:47:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "caarmen",
    "github_project": "cycle-plotter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cycle-plotter"
}
        
Elapsed time: 0.35414s