A high-performance Python library for processing and analysing data from CARP (Copenhagen Research Platform) clinical studies
Project description
CARP Analytics Python
carp-analytics-python is a Python library for working with CARP study data. It focuses on streaming JSON records, participant lookup, schema discovery, export, parquet conversion, and optional plotting.
Quick Start
from carp import CarpStudy
study = CarpStudy("sleep-data/phase-1-1/data-streams.json")
print(study.records.count())
print(study.participants.summary_rows()[0])
Main API
CarpStudy is the primary entrypoint.
from carp import CarpStudy
study = CarpStudy([
"sleep-data/phase-1-1/data-streams.json",
"sleep-data/phase-2-1/data-streams.json",
])
study.schema.scan()
study.export.export_json("output.json", data_type="dk.cachet.carp.stepcount")
study.frames.convert_to_parquet("output_parquet")
study.participant("alice@example.com").info()
CLI
carp schema sleep-data/phase-1-1/data-streams.json
carp count sleep-data/phase-1-1/data-streams.json
carp participants sleep-data/phase-1-1/data-streams.json
carp export sleep-data/phase-1-1/data-streams.json -o output.json -t dk.cachet.carp.stepcount
carp group sleep-data/phase-1-1/data-streams.json -o grouped_output
carp convert sleep-data/phase-1-1/data-streams.json -o output_parquet
Documentation
The docs are built with Sphinx, autodoc, and napoleon.
python -m pip install sphinx sphinx-rtd-theme
sphinx-build -b html docs docs/_build/html
Examples
python examples/main.py sleep-data/phase-1-1/data-streams.json
python examples/disc.py sleep-data/phase-1-1/data-streams.json
Optional Dependencies
pandas and pyarrow enable dataframe and parquet support. folium enables plotting.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file carp_analytics_python-0.2.0.tar.gz.
File metadata
- Download URL: carp_analytics_python-0.2.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a58f22a18124993426ae7c7af7b408123b90ab32e0073fe0af94bac38b156aa
|
|
| MD5 |
2d1ad55dced1cddef3717ea7e733080a
|
|
| BLAKE2b-256 |
e80287789ddb8efb0dac9dd822309804651f96a24026f65676211fd5127b2ae6
|
Provenance
The following attestation bundles were made for carp_analytics_python-0.2.0.tar.gz:
Publisher:
release.yml on carp-dk/carp-analytics-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carp_analytics_python-0.2.0.tar.gz -
Subject digest:
5a58f22a18124993426ae7c7af7b408123b90ab32e0073fe0af94bac38b156aa - Sigstore transparency entry: 1185741260
- Sigstore integration time:
-
Permalink:
carp-dk/carp-analytics-python@449aca0d1c5931310234b4843eacc887fbd22ca4 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/carp-dk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@449aca0d1c5931310234b4843eacc887fbd22ca4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file carp_analytics_python-0.2.0-py3-none-any.whl.
File metadata
- Download URL: carp_analytics_python-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1fabccfe1c6034ed22ba3b044e8898566054b7055ad1035596fd9c582924f91
|
|
| MD5 |
457106033291747e306a130cd9c9b7f3
|
|
| BLAKE2b-256 |
d259bbc92d5dd4ddc41b954c1b36eae4d1a9bacb4bae2465c079b747d9330b0f
|
Provenance
The following attestation bundles were made for carp_analytics_python-0.2.0-py3-none-any.whl:
Publisher:
release.yml on carp-dk/carp-analytics-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carp_analytics_python-0.2.0-py3-none-any.whl -
Subject digest:
a1fabccfe1c6034ed22ba3b044e8898566054b7055ad1035596fd9c582924f91 - Sigstore transparency entry: 1185741278
- Sigstore integration time:
-
Permalink:
carp-dk/carp-analytics-python@449aca0d1c5931310234b4843eacc887fbd22ca4 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/carp-dk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@449aca0d1c5931310234b4843eacc887fbd22ca4 -
Trigger Event:
push
-
Statement type: