Skip to main content

Data management and scoring tools for the M2C2 project

Project description

M2DataKit

Universal loading, assurance, scoring, and export tools for M2C2 cognitive assessment data.

🚀 A Python toolkit for working with M2C2kit data from multiple sources including MongoDB, MetricWire, Qualtrics, UAS, CSV bundles, and the M2C2 API.

PyPI version


Installation

pip install m2datakit

or

pip3 install m2datakit

Documentation

📘 https://m2c2-project.github.io/datakit/site/index.html


Supported Data Sources

M2DataKit supports importing and harmonizing data from multiple platforms and export formats.

Source Type Loader Description
MongoDB MongoDBImporter Flat or nested MongoDB JSON exports
MetricWire MetricWireImporter MetricWire JSON exports
Qualtrics QualtricsImporter Qualtrics CSV exports
UAS UASImporter Understanding America Study exports
MultiCSV MultiCSVImporter Multiple CSV files grouped by activity
M2C2 API M2C2KitAPIImporter Direct API access with authentication
M2C2 Static M2C2StaticImporter Static flat CSV exports

L.A.S.S.I.E. Pipeline

Step Method Purpose
L load() Load raw data
A assure() Validate required columns
S score() Apply scoring rules
S summarize() Aggregate participant/session metrics
I inspect() Quality checks and visualization
E export() Save tidy outputs and metadata

Example Usage

MetricWire

import m2datakit as m2

mw = (
    m2.core.pipeline.LASSIE()
    .load(
        source_name="metricwire",
        source_path="data/metricwire/unzipped/*/*/*.json"
    )
)

mw.assure(
    required_columns=m2.core.config.settings.STANDARD_GROUPING_FOR_AGGREGATION_METRICWIRE
)

mw.score()

mw.inspect()

mw.export(
    file_basename="metricwire",
    directory="tidy/metricwire_scored"
)

MongoDB

mdb = (
    m2.core.pipeline.LASSIE()
    .load(
        source_name="mongodb",
        source_path="data/export.json"
    )
)

mdb.assure(
    required_columns=m2.core.config.settings.STANDARD_GROUPING_FOR_AGGREGATION
)

mdb.score()

mdb.export(
    file_basename="mongodb_export",
    directory="tidy/mongodb_scored"
)

M2C2 API

api = (
    m2.core.pipeline.LASSIE()
    .load(
        source_name="m2c2kit-api",
        source_path="https://api.m2c2kit.com",
        study_id="YOUR_STUDY_ID",
        username="USERNAME",
        password="PASSWORD"
    )
)

api.score()

Developer Setup

make clean
make dev-install

Contributing

Contributions, issues, and feature requests are welcome.

📌 Open an issue: https://github.com/m2c2-project/datakit


Resources


Citation

If you use M2DataKit in your research, please cite the project and associated publications.


Acknowledgements

Development of m2datakit was supported by:

  • NIA Grant: 1U2CAG060408-01

Developers


🚀 Let's go study some brains!

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

m2datakit-0.1.106.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

m2datakit-0.1.106-py3-none-any.whl (87.6 kB view details)

Uploaded Python 3

File details

Details for the file m2datakit-0.1.106.tar.gz.

File metadata

  • Download URL: m2datakit-0.1.106.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for m2datakit-0.1.106.tar.gz
Algorithm Hash digest
SHA256 72de518dffe6bfa1f8c309795c2507f5c19eb0ff67dc95ba66b1f2a53499f722
MD5 6b8128184f53e6008b6ce49f700c8858
BLAKE2b-256 d704bd8e707bfbb58ac8f36bbc876efff812cbe0e10b6efbe772bd6eebe7eaf9

See more details on using hashes here.

File details

Details for the file m2datakit-0.1.106-py3-none-any.whl.

File metadata

  • Download URL: m2datakit-0.1.106-py3-none-any.whl
  • Upload date:
  • Size: 87.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for m2datakit-0.1.106-py3-none-any.whl
Algorithm Hash digest
SHA256 b98d15a2edc71decdac41db8a04ed5a3157d54b65f5e9c05c0045d28328f1b7f
MD5 40cebcfc94c57d5fe2dc5bc959a1d00b
BLAKE2b-256 02f57f3f7934f554f0b8c6bcf81c84106c9dd06c90a2a2910219f56def56eed8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page