Skip to main content

The Cortex data analysis toolkit for the LAMP Platform.

Project description

Cortex data analysis pipeline for the LAMP Platform.

Overview

This API client is used to process and featurize data collected in LAMP. Visit our documentation for more information about the LAMP Platform.

Installation

Prerequisites

Python 3.4+ and pip.

  • You may need root permissions, using sudo.
  • Alternatively, to install locally, use pip --user.
  • If pip is not recognized as a command, use python3 -m pip.

Installation

pip install git+https://github.com/BIDMCDigitalPsychiatry/LAMP-cortex.git@master

Alternatively, instead of pip install, you may need to use python3 -m pip install --user.

Configuration

Ensure your server_address is set correctly. If using the default server, it will be api.lamp.digital. Keep your access_key (sometimes an email address) and secret_key (sometimes a password) private and do not share them with others. While you are able to set these parameters as arguments to the cortex executable, it is preferred to set them as session-wide environment variables. You can also run the script from the command line:

LAMP_SERVER_ADDRESS=api.lamp.digital LAMP_ACCESS_KEY=XXX LAMP_SECRET_KEY=XXX python3 -m \
  cortex significant_locations \
    --id=U26468383 \
    --start=1583532346000 \
    --end=1583618746000 \
    --k_max=9

Or another example using the CLI arguments instead of environment variables (and outputting to a file):

python3 -m \
  cortex --format=csv --server-address=api.lamp.digital --access-key=XXX --secret-key=XXX \
    survey --id=U26468383 --start=1583532346000 --end=1583618746000 \
    2>/dev/null 1>./my_cortex_output.csv

Example

# environment variables must already contain LAMP configuration info
from pprint import pprint
from cortex import all_features, significant_locations, trips
pprint(all_features())
for i in range(1583532346000, 1585363115000, 86400000):
    pprint(significant_locations(id="U26468383", start=i, end=i + 86400000))

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

LAMP-cortex-2021.9.17.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

LAMP_cortex-2021.9.17-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file LAMP-cortex-2021.9.17.tar.gz.

File metadata

  • Download URL: LAMP-cortex-2021.9.17.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Linux/5.8.0-1041-azure

File hashes

Hashes for LAMP-cortex-2021.9.17.tar.gz
Algorithm Hash digest
SHA256 05234d66f1bbaa7a9b27542e8abaddaf290c3ae3f6d0866ca0b87cf8a27648cf
MD5 77c68ef8d94e88fe74634b9c52e12adc
BLAKE2b-256 43520b3eae098b5210e7ee504cd1808af13d05335a559198443e0bbf6c354808

See more details on using hashes here.

File details

Details for the file LAMP_cortex-2021.9.17-py3-none-any.whl.

File metadata

  • Download URL: LAMP_cortex-2021.9.17-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Linux/5.8.0-1041-azure

File hashes

Hashes for LAMP_cortex-2021.9.17-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed6ccd82417f05b8e7c240799e7394667ae6a17c040cf062d454c654f471140
MD5 a69d162506f28d04e351d43a587cc9ec
BLAKE2b-256 68f7dae8b3dd5e190df4f5eecd28f61705f8e25c3450c1c351eb693896a29355

See more details on using hashes here.

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