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.103.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.103-py3-none-any.whl (86.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: m2datakit-0.1.103.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.103.tar.gz
Algorithm Hash digest
SHA256 0df833b00f0db4b1217e1e0a3369a6bc1ec9a358c628bd63239431b4b53fec2a
MD5 c682c236f165315e117d924089d6b135
BLAKE2b-256 5423643089db4d1ff75352014927a883be24588829c1b3c38822338b46f6185e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2datakit-0.1.103-py3-none-any.whl
  • Upload date:
  • Size: 86.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.103-py3-none-any.whl
Algorithm Hash digest
SHA256 0c2bbdd020a8c435706d9e115b26bb785291af75ee663e5f8fb2cdac3216bd94
MD5 7e8e27bf8f19b3ac27079de23e5a76f9
BLAKE2b-256 51c634a7b3171ec7f32967a7b753da9914aa781bbb9fc9defca2c3a46a7085ba

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