这个软件包提供了一些基本工具来分析从apple health下载的csv文件中的健康数据。
myFitness的Python项目详细描述
myfitness
:分析苹果健康数据的工具
苹果健康追踪系统是一个由莉莎·伍德和利尔达尔合作的项目。
myfitness
包提供了一些基本工具来分析从apple health下载的csv文件中的运行状况数据。这些工具可以用来分析和比较来自多个人的数据。
healthdata
- 包含两个模块
data
-包含个人的姓名、年龄和性别(“超类”)以及使用pandas读取csv健康数据文件的方法chart
-使用pygal向用户提供交互式条形图
summary
- 包含两个模块
table
-返回每月平均步数的摘要数据框
^ 的最大和最小数目的函数
包装结构
myfitness
-->;包
healthdata
-->;子包data
-->;模块chart
-->;模块
summary
-->;子包table
-->;模块maxmin
-->;模块
套餐详情
下面介绍myfitness
的包函数。此存储库中包含的测试文件也演示了包的使用。
healthdata
此子包为用户提供了一种导入数据以及交互式查看数据的方法。
关于healthdata
子包中data
模块的详细描述如下:
Class/Function | Description | Parameters | Return |
---|---|---|---|
^{ | 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 |
^{ | 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 |
关于healthdata
子包中chart
函数的详细描述如下:
Function | Description | Parameters | Return |
---|---|---|---|
^{ | 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
此子包为用户提供一些基本的统计分析工具,以查看从Apple Health提取的数据。
关于summary
子包中table
函数的详细描述如下:
Function | Description | Parameters | Return |
---|---|---|---|
^{ | 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. |
有关summary
子包中maxMin
函数的详细说明如下:
Function | Description | Parameters | Return |
---|---|---|---|
^{ | 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) |
^{ | 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) |
测试
myfitness_tests
包含必要的测试套件和类,以验证包是否正常工作。共有四个类执行单元测试和套件。
测试套件封面报告
要求
此包需要以下Python模块:
- 努比
- 熊猫
- 皮加尔
- 伊普顿
- cairosvg