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.107.tar.gz (85.9 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.107-py3-none-any.whl (90.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: m2datakit-0.1.107.tar.gz
  • Upload date:
  • Size: 85.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.107.tar.gz
Algorithm Hash digest
SHA256 ae63a4bb2ae19963e5caf5502d0cf5604f1f939147463e77c8b48c29a6db33bc
MD5 bf3213839bb2087626bed6ce4eef0f68
BLAKE2b-256 33db83c3b8f9f464503a068a816b86f3570d0ec6bae0fe9c6138b261646d1ad9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2datakit-0.1.107-py3-none-any.whl
  • Upload date:
  • Size: 90.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.107-py3-none-any.whl
Algorithm Hash digest
SHA256 3964f886bf8fec21c90572e74216a194a770f4fd62acb1d0aa7536f115ce8e3f
MD5 3b44a841946c89d41f4717aa379edd2c
BLAKE2b-256 d8dae9827129b8b37cc3312c2c3e42f98a6c3183f031a9a86bc8521c962dc965

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