Skip to main content

myfitness: Tools to Analyze Apple Health Data


Build_Stamp Build Status


The Apple Health Fitness Tracker was a collaborative project by Liza Wood and Levannia Lildhar.

The myfitness package provides some basic tools to analyze the health data in a CSV file downloaded from Apple Health. These tools could be used to analyze and compare the data from multiple people.

healthdata

  • contains two modules
    1. data - contains the name, age and gender of the person (the "superclass") and a method to read in the CSV health data file using pandas
    2. chart - uses pygal to provide an interactive bar chart to the user

summary

  • contains two modules
    1. table - returns a summarized dataframe of average steps per month
    2. maxmin- contains functions to calculate the maximum and minimum number of steps

Package Structure

myfitness --> package

  • healthdata --> sub-package

    • data --> module
    • chart -->module
  • summary --> sub-package

    • table --> module
    • maxmin --> module

Package Details

The package functions of myfitness are described below. The use of the package is also demonstrated in the test file included in this repositry.

healthdata

This subpackage provides users a method of importing data as well as viewing the data interactively.

Detailed descriptions of the data module in the healthdata subpackage is shown below:

Class/Function Description Parameters Return
Person Create an object of class Person() to be used in further analysis. The 'display' function displays the name, age and gender of a Person() object name, age, gender An object of class Person with name, age and gender attributes
healthdata Create a object of class healthdata() this inherits from the superclass Person() name, age, gender, file (downloaded from Apple Health, as CSV) Display of healthdata object attributes name, age, gender and dataframe containing healthdata() object file

Detailed descriptions of the chart function in the healthdata subpackage is shown below:

Function Description Parameters Return
chart Creates an interactive bar graph using pygal columnX as list of strings, columnY as list of values, xlabel as string, ylabel as string, filename .svg file with xlabel, ylabel, title, and filename

summary

This subpackage provides users with some basic statistical analysis tools to view their data extracted from Apple Health.

Detailed descriptions of the table function in the summary subpackage is shown below:

Function Description Parameters Return
table Function to summarize the average number of steps taken per month using the pandas package data: Apple Health .csv file imported as a Pandas DataFrame A Pandas dataframe, summarizing the average number of steps taken by month, indicated by the last date of the month.

Detailed descriptions of the maxMin function in the summary subpackage is shown below:

Function Description Parameters Return
getMax Find the maximum number of steps in the data and the date it was achieved. data: Pandas DataFrame containing Apple Health data imported from a CSV file. The row of values for when the maximum number of steps were achieved:Start date, Finish date,Distance(mi), Steps (count)
getMin Find the maximum number of steps in the data and the date it was achieved. data: Pandas DataFrame containing Apple Health data imported from a CSV file. The row of values for when the maximum number of steps were achieved:Start date, Finish date, Distance(mi), Steps (count)

Testing

myfitness_tests contains the necessary test suite and classes to verify that the package is working correctly. There are a total of four classes that conduct unit testing as well as the suite.

Test Suite Coverge Report Coverage Report

Requirements

This package requires the following Python modules:

  • numpy
  • pandas
  • pygal
  • IPython
  • CairoSVG

Metadata

Release files for myFitness 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myFitness 0.3
File Size Uploaded
myFitness-0.3.tar.gz 4.4 kB Details

Release files / myFitness-0.3.tar.gz

Download URL myFitness-0.3.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f0acfa7fc05bd9d9ded25cb5ec406df0314dc070444ae28281007bc8510d4f55
BLAKE2b-256 checksum
How to use checksums
0e51859a93df4242e8415726f94b4efd0f3370d325ba976a055d58bd78048b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page