Skip to main content

Python repository to facilitate using the Tidepool API (forked).

Project description

Tidepool API - Data Science Python Bindings

-- Project Status: Active

-- Project Disclaimer: This work is for Development

Project Objective

The purpose of this project is to

  • Expose in an organized way the Tidepool API in Python
  • Support data science tasks and projects that use Tidepool data

Project Description

This project is a large refactor of Data Science code integrating with and using the Tidepool API.

Getting Started with this project

Tidepool API

See tidepool_api.py for class representing the api. Code example of downloading health data for a user:

from data_science_tidepool_api_python.makedata.tidepool_api import TidepoolAPI

tp_api = TidepoolAPI(username, password)
tp_api.login()
user_data = tp_api.get_user_event_data()
tp_api.logout()

Projects using the API:

The Tidepool Big Data Donation Project data science code lives in projects/tbddp. The Tidepool Period Project data science code lives in projects/tbddp

Contributing Guide

  1. All are welcome to contribute to this project.
  2. Naming convention for notebooks is [short_description]-[initials]-[date_created]-[version], e.g. initial_data_exploration-jqp-2020-04-25-v-0-1-0.ipynb. A short _ delimited description, the creator's initials, date of creation, and a version number,
  3. Naming convention for data files, figures, and tables is [PHI (if applicable)]-[short_description]-[date created or downloaded]-[code_version], e.g. raw_project_data_from_mnist-2020-04-25-v-0-1-0.csv, or project_data_figure-2020-04-25-v-0-1-0.png.

NOTE: PHI data is never stored in github and the .gitignore file includes this requirement as well.

Tidepool Data Science Team

Name (with github link) Tidepool Slack
Cameron Summers @Cameron Summers

Technologies (Update this list)

  • Python (99% of the time)
  • Anaconda for our virtual environments
  • Pandas for working with data (99% of the time)
  • Google Colab for sharing examples
  • Pytest for testing
  • Travis for continuous integration testing
  • Black for code style
  • Flake8 for linting
  • Sphinx for documentation
  • Numpy docstring format
  • pre-commit for githooks

Getting Started with the Conda Virtual Environment

  1. Install Miniconda. CAUTION for python virtual env users: Anaconda will automatically update your .bash_profile so that conda is launched automatically when you open a terminal. You can deactivate with the command conda deactivate or you can edit your bash_profile.
  2. If you are new to Anaconda check out their getting started docs.
  3. If you want the pre-commit githooks to install automatically, then following these directions.
  4. Clone this repo (for help see this tutorial).
  5. In a terminal, navigate to the directory where you cloned this repo.
  6. Run conda update -n base -c defaults conda to update to the latest version of conda
  7. Run conda env create -f conda-environment.yml --name [input-your-env-name-here]. This will download all of the package dependencies and install them in a conda (python) virtual environment. (Insert your conda env name in the brackets. Do not include the brackets)
  8. Run conda env list to get a list of conda environments and select the environment that was created from the environmental.yml file (hint: environment name is at the top of the file)
  9. Run conda activate <conda-env-name> or source activate <conda-env-name> to start the environment.
  10. If you did not setup your global git-template to automatically install the pre-commit githooks, then run pre-commit install to enable the githooks.
  11. Run deactivate to stop the environment.

Maintaining Compatability with venv and virtualenv

This may seem counterintuitive, but when you are loading new packages into your conda virtual environment, load them in using pip, and export your environment using pip-chill > requirements.txt. We take this approach to make our code compatible with people that prefer to use venv or virtualenv. This may also make it easier to convert existing packages into pypi packages. We only install packages directly in conda using the conda-environment.yml file when packages are not available via pip (e.g., R and plotly-orca).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tidepool_data_science_project-0.0.3.tar.gz (14.3 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page