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.104.tar.gz (82.2 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.104-py3-none-any.whl (86.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: m2datakit-0.1.104.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","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.104.tar.gz
Algorithm Hash digest
SHA256 25be927a60a5483eaaa21ce8713a5f120f097be320e8a4b8f137d31d54d2623d
MD5 a8edc4eb3003ed827fd321ed97e41993
BLAKE2b-256 48944dcc21e51526c5f1ade931fe8c744f13c4222e6168b7739a7be129559695

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2datakit-0.1.104-py3-none-any.whl
  • Upload date:
  • Size: 86.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","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.104-py3-none-any.whl
Algorithm Hash digest
SHA256 c229ab351cc10ab44ed2e98454969e9c4801ffe73320064d7e39f5154dd86d5d
MD5 691d9a34ce77c874a1c15c6be3ba4aad
BLAKE2b-256 58fa2d4a482d4bcdc3da0eda4548f6ddeb4e3004905c20df0f040ce1df4778e8

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