Skip to main content

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.

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-2.0.tar.gz (24.6 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for willisapi_client-2.0.tar.gz
Algorithm Hash digest
SHA256 0636cc5bdc86fa4e76eb9193d0ee6c48dd40141d8704a58f4fe64ca1bfe66cdc
MD5 f9636ff57c0898410f8aecc1d218e240
BLAKE2b-256 63b32c8d0bc8e6acb942ef31de4e086d145c61de14b6b45053f56a7af51592d2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0 This release

1 file

1.9.9

1 file

1.9.8

1 file

1.9.7

1 file

1.9.6

1 file

1.9.5

1 file

1.9.4

1 file

1.9.3

1 file

1.9.2

1 file

1.9.1

1 file

1.9

1 file

1.8

1 file

1.7

1 file

1.6

1 file

1.5

1 file

1.4

1 file

1.2

1 file

1.1

1 file

1.0

1 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