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

Uploaded Python 3

File details

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

File metadata

  • Download URL: m2datakit-0.1.105.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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.105.tar.gz
Algorithm Hash digest
SHA256 5c1f9e5ecea23a696d3b35dbbd44f32c664392a3c8957264ecf3a94fc5aa6b91
MD5 2ec54fab881e2c8b897ba3061c05c244
BLAKE2b-256 613961d361db3ebaa01f466f63a451d88e3d4ebef724a68d44e9c05839f3c9ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: m2datakit-0.1.105-py3-none-any.whl
  • Upload date:
  • Size: 86.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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.105-py3-none-any.whl
Algorithm Hash digest
SHA256 c70396a09d4724052468aeae26e86c7e4bdbca818920c0c9ecd5a356542c28de
MD5 b40ac2de6df1c74739e0745677b732a1
BLAKE2b-256 e0894139b27de6fbba2c8a43cc7d2c2dab864cf36007c825a00dbbdb69230d6e

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