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, usepython3 -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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file LAMP-cortex-2022.3.11.tar.gz
.
File metadata
- Download URL: LAMP-cortex-2022.3.11.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3fb1e996115f7a537b3da1a0af4451ec873c9017dd0d2b6762f9d61861a5a7 |
|
MD5 | e40d833a7097f812f41cc536376e944e |
|
BLAKE2b-256 | 02f2ef20fd8d68e6f2557f7864cb2eb26c0dc8201d8477c49c9945642ef076bc |
File details
Details for the file LAMP_cortex-2022.3.11-py3-none-any.whl
.
File metadata
- Download URL: LAMP_cortex-2022.3.11-py3-none-any.whl
- Upload date:
- Size: 72.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32c4e1609a413d39884a371374a1fb493628eaabdbef35892d7a010280331bc8 |
|
MD5 | 44ad45c1c74a0ee094148ec15139dcae |
|
BLAKE2b-256 | 7a747947c60a895c734005b40a2789e7f34f5a4210429f2ce064f68c842f17ed |