This package provides some basic tools to analyze the health data in a CSV file downloaded from Apple Health.
Project description
myfitness
: Tools to Analyze Apple Health Data
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
data
- contains the name, age and gender of the person (the "superclass") and a method to read in the CSV health data file using pandaschart
- uses pygal to provide an interactive bar chart to the user
summary
- contains two modules
table
- returns a summarized dataframe of average steps per monthmaxmin
- contains functions to calculate the maximum and minimum number of steps
Package Structure
myfitness
--> package
-
healthdata
--> sub-packagedata
--> modulechart
-->module
-
summary
--> sub-packagetable
--> modulemaxmin
--> 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
Requirements
This package requires the following Python modules:
- numpy
- pandas
- pygal
- IPython
- CairoSVG
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file myFitness-0.3.tar.gz
.
File metadata
- Download URL: myFitness-0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0acfa7fc05bd9d9ded25cb5ec406df0314dc070444ae28281007bc8510d4f55 |
|
MD5 | 6981ce5138a8137d88fd8b752ab31c18 |
|
BLAKE2b-256 | 0e51859a93df4242e8415726f94b4efd0f3370d325ba976a055d58bd78048b08 |