Skip to main content

CARP Analytics Python

PyPI version Python versions License: MIT

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.

Metadata

Release files for carp-analytics-python 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for carp-analytics-python 0.2.0
File Size Uploaded
carp_analytics_python-0.2.0.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for carp-analytics-python 0.2.0
File Interpreter ABI Platform
carp_analytics_python-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.8 kB

Release files / carp_analytics_python-0.2.0.tar.gz

Download URL carp_analytics_python-0.2.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5a58f22a18124993426ae7c7af7b408123b90ab32e0073fe0af94bac38b156aa
BLAKE2b-256 checksum
How to use checksums
e80287789ddb8efb0dac9dd822309804651f96a24026f65676211fd5127b2ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / carp_analytics_python-0.2.0-py3-none-any.whl

Download URL carp_analytics_python-0.2.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1fabccfe1c6034ed22ba3b044e8898566054b7055ad1035596fd9c582924f91
BLAKE2b-256 checksum
How to use checksums
d259bbc92d5dd4ddc41b954c1b36eae4d1a9bacb4bae2465c079b747d9330b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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