Skip to main content

mava-exchange

PyPI version Python License Tests Documentation

Authors:

mava-exchange

A Python library and standard package format for exchanging video annotation data between research tools.

Documentation

📚 Full Documentation - Complete user guide and API reference

Quick links:

Project Context

This work is part of the MAVA Project, which aims to improve interoperability and data exchange among three research tools — VideoScope, TIB-AV-A, and VIAN. By standardising data formats and developing tools to import, export, and validate annotation packages, the project enhances data sharing and analysis capabilities across linguistic, media studies, and audiovisual research.

This infrastructure will enable shared research workflows and ensure adherence to FAIR principles, improving the accessibility and reusability of research data.

The Challenge

Video analysis via AI is computationally expensive and produces large datasets — continuous observations such as emotion scores, scene analysis, and audio features accumulate quickly across a corpus. It is therefore desirable to share these results among video processing tools without recomputing them.

What is needed is a common data exchange format and tools to write, read, and validate packages in that format. Packages should be:

  • Interoperable and self-describing
  • Efficient to write and compact in file size

mava-exchange

mava-exchange addresses this with a standard package format for video annotation corpora called .mediapkg. The library has two goals:

Format definition — mava-exchange defines the .mediapkg standard: a ZIP archive containing annotation data as Parquet files alongside a manifest that maps columns to the MAVA ontology via JSON-LD.

Tooling — mava-exchange provides a Python library and CLI tools to write, read, inspect, and validate .mediapkg packages.

Design Choices

  • ZIP + Parquet — the .mediapkg is a ZIP archive containing one Parquet file per annotation track. Parquet offers compact storage, efficient reads, and columnar access. ZIP provides a universal container that any tool can open for inspection.

  • JSON-LD manifest — each package contains a manifest.json with a JSON-LD @context that maps Parquet column names to terms in the MAVA ontology. This is the semantic layer — it describes what each column means without being part of the data itself.

  • MAVA ontology — the ontology defines a shared vocabulary for annotation tracks, time coordinates, and observation dimensions. SHACL shapes are included for formal validation.

  • Python — the library is implemented in Python, as all participating tools use Python. Support for other languages may be added in future releases.

Inspiration

This format is inspired by GeoJSON and GeoParquet. GeoParquet embeds spatial metadata inside Parquet files to describe geometry columns. mava-exchange applies the same principle to temporal data: where GeoParquet uses spatial coordinates, mava-exchange uses time coordinates on a video timeline. Where GeoParquet metadata is purely operational, mava-exchange adds a semantic layer via JSON-LD to link columns to a shared ontology.

Using the library

Install from PyPI:

pip install mava-exchange

Write, read, and validate .mediapkg packages:

from mava_exchange import (
    MediaPackageWriter, MediaPackageReader,
    ObservationSeries, AnnotationSeries, DimensionSpec,
)

# Define what your tracks mean
emotions = ObservationSeries(
    name="emotions",
    description="Face emotion scores from DeepFace",
    sampling_interval=0.5,
    dimensions=[
        DimensionSpec("angry",   "Anger probability",  "[0,1]"),
        DimensionSpec("neutral", "Neutral expression", "[0,1]"),
    ]
)

# Write a package
with MediaPackageWriter("corpus.mediapkg") as writer:
    writer.add_video("video_001", "https://example.org/talk.mp4")
    writer.add_track("video_001", emotions, emotions_df)

# Read it back
with MediaPackageReader("corpus.mediapkg") as reader:
    df = reader.read_track("video_001", "emotions")

Two CLI tools are also available after installation:

mediapkg-inspect  corpus.mediapkg
mediapkg-validate corpus.mediapkg

👉 See the full tutorial for a complete walkthrough.

Development

Clone the repository and install in editable mode with development dependencies:

git clone https://github.com/sdsc-ordes/mava-exchange.git
cd mava-exchange
uv sync --group dev

The project uses just as a task runner:

just test      # run the test suite
just lint      # run ruff
just format    # format with ruff and treefmt
just build     # build the package

To run the example that converts real TSV annotation files into a .mediapkg corpus:

just example                                                    # create example corpus from TSV files
mediapkg-inspect examples/output/corpus.mediapkg                # inspect the resulting corpus.mediapkg
mediapkg-inspect examples/output/corpus.mediapkg --format turtle # view manifest as Turtle RDF
just validate examples/output/corpus.mediapkg                   # validate the package
just unpack examples/output/corpus.mediapkg tmp/pkg            # unzip to inspect/edit (tmp/ is gitignored), then `just pack tmp/pkg out.mediapkg`

Further Reading

For development:

License

Apache-2.0

Acknowledgements

This work was funded by the Swiss Data Science Center (SDSC) through its National Call for Projects as an Infrastructure project.

We gratefully acknowledge the contributions of the SDSC experts and our partners.

SDSC Experts:

Partner Institutions

How to Cite

If you use this software, please cite it as follows:

👉 See the CITATION.cff file for the full list of software authors and citation formats.

When referring to the project more broadly (including partner contributions), please acknowledge the funding statement and collaborators listed in the Acknowledgements section:

"This work was funded by the Swiss Data Science Center (SDSC) through its National Call for Projects as an Infrastructure project."

Copyright © 2025-2026 Swiss Data Science Center (SDSC),www.datascience.ch, ROR: ror.org/02hdt9m26. All rights reserved. The SDSC is a Swiss National Research Infrastructure, jointly established and legally represented by the École Polytechnique Fédérale de Lausanne (EPFL) and the Eidgenössische Technische Hochschule Zürich (ETH Zürich) as a société simple. This copyright encompasses all materials, software, documentation, and other content created and developed by the SDSC.

Metadata

Release files for mava-exchange 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mava-exchange 0.2.1
File Size Uploaded Provenance Actions
mava_exchange-0.2.1.tar.gz 365.3 kB With provenance Details for mava_exchange-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mava-exchange 0.2.1
File Interpreter ABI Platform Actions
mava_exchange-0.2.1-py3-none-any.whl Python 3 none any Details for mava_exchange-0.2.1-py3-none-any.whl

Total release size: 393.2 kB

Release files / mava_exchange-0.2.1.tar.gz

Download URL mava_exchange-0.2.1.tar.gz
Size 365.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6d3e309b3db4d876ef65aab64bf9776177f479bf0d2fac40c7a1498683a1b561
BLAKE2b-256 checksum
How to use checksums
bf49ff9533c7b09700e4f463dcb074c2321c9e2ca8c0a524f69b399161bb09b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / mava_exchange-0.2.1-py3-none-any.whl

Download URL mava_exchange-0.2.1-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e166bf39dbc3d3702e3546e1dcf2a4f75a6284cb1bec9f4f12912fd588299b5e
BLAKE2b-256 checksum
How to use checksums
38b6bbf95433ebf37758666975ae99a8668d7cf29ca4c3aa6d599588ca5091cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for mava-exchange 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mava_exchange-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page