Skip to main content

A Python client for willisapi

Project description

WillisAPI Client

WillisAPI Client is the Python interface for Brooklyn Health’s WillisAPI.

Official documentation for WillisAPI Client can be found in the Github Wiki.

To learn more about Brooklyn Health or WillisAPI, visit brooklyn.health or getintouch@brooklyn.health.


Installation

pip install willisapi_client

Getting a Personal Access Token (PAT)

  1. Log in to the Brooklyn Health web application.
  2. Go to your profile section.
  3. Navigate to Personal Access Token (PAT) and copy it for use in the client.

Usage

Upload To upload a CSV file:

summary = willisapi.upload(key, '/path/to/data.csv')

How to Call the Function

  • key: Your PAT token.
  • data.csv: Path to your CSV file.

How to Reupload

If you need to reupload the same or updated file, simply call the upload function again:

summary = willisapi.upload(key, 'data.csv', force_uploade=True)

Understanding Returned DataFrame and Errors

  • The upload function returns a summary DataFrame containing the results of your upload.
  • Columns typically include status, error messages, and metadata for each row in your CSV.
  • If there are errors, they will be listed in the DataFrame under an error or message column.
  • Review the DataFrame to identify and resolve any issues before reuploading.

CSV Validation Details

Before uploading, the client validates your CSV for:

  • Required Columns: Must include study_id, site_id, participant_id, visit_name, visit_order, coa_name, coa_item_number, coa_item_value, file_path, time_collected.
  • Optional Columns: rater_id, age, sex, race, language.
  • Valid COA Name: Only these values are allowed: MADRS, YMRS, PHQ-9, GAD-7.
  • Valid Audio File: The file path in each row must exist and be accessible.
  • Valid Data Types: visit_order, age, coa_item_number, and coa_item_value must be numeric.
  • Language: If present, must be in the allowed language choices.

If any validation fails, errors are collected and returned for review before upload proceeds.


Processed Data Upload

To upload a processed data CSV file:

summary = willisapi.processed_upload(key, '/path/to/processed-data.csv')

How to Call the Function

  • key: Your PAT token.
  • processed-data.csv: Path to your processed data CSV file.

For more information on how to organize the data.csv, visit the Github Wiki.

If you run into trouble while using the client, please raise it in the Issues tab.


Brooklyn Health is a small team of clinicians, scientists, and engineers based in Brooklyn, NY.

We develop and maintain OpenWillis, an open source python library for digital health measurement.

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

willisapi_client-1.9.5.tar.gz (20.3 kB view details)

Uploaded Source

File details

Details for the file willisapi_client-1.9.5.tar.gz.

File metadata

  • Download URL: willisapi_client-1.9.5.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for willisapi_client-1.9.5.tar.gz
Algorithm Hash digest
SHA256 38b6c5e24f5b7edbda5a3fe1fa8d349b4391696d875e1b47a3d87ce98ef4dd65
MD5 23567466d1ede2d704a7629bd7c734d3
BLAKE2b-256 65ec7dbd04aa2e0228a1ff469d19cc10d9773e32c8020355344d382f0352a789

See more details on using hashes here.

Supported by

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