Skip to main content

Automatic provenance for AI-driven research pipelines

Project description

mareforma

Python Tests PyPI License: MIT

Automatic epistemic provenance for life sciences pipelines. Write transforms, run build, and mareforma figures out what kind of result you produced and how well-supported it is — no manual annotation required.


Install

uv pip install mareforma

Requires Python ≥ 3.10.


How it works

Write normal Python pipeline functions. mareforma auto-classifies each result.

from mareforma import transform, BuildContext
import pandas as pd

@transform("morphology.load")
def load(ctx: BuildContext) -> None:
    files = list(ctx.source_path("morphology").glob("*.swc"))
    ctx.save("skeletons", files, fmt="pickle")

@transform("morphology.features", depends_on=["morphology.load"])
def compute_features(ctx: BuildContext) -> None:
    skeletons = ctx.load("morphology.load.skeletons")
    df = pd.DataFrame([_extract_features(s) for s in skeletons])
    ctx.save("features", df, fmt="csv")
mareforma build
# ✓ morphology.load      done  (1.2s)
# ✓ morphology.features  done  (3.8s)

mareforma trace morphology.features
# morphology
# └── morphology.load ──────── RAW        ── SINGLE
#     └── morphology.features  ANALYSED   ── REPLICATED ◇

That's it. No annotations. mareforma reads your artifacts, classifies each transform, and tracks support level automatically.


What gets classified automatically

Transform class — inferred from artifact content:

Class Meaning
RAW Root node — no upstream dependencies
PROCESSED Output values ⊆ input values, row count ≤ input count
ANALYSED New values computed, within input value range
INFERRED Output values outside all input ranges

Support level — inferred from run history:

Level Meaning
SINGLE One run
REPLICATED ◇ Same output hash across ≥2 runs
CONVERGED ● Same step name across ≥2 independent sources
CONSISTENT ◆ A run has a DOI-linked claim in supports
ESTABLISHED ●● CONVERGED + CONSISTENT

SINGLE through CONVERGED require no annotation. CONSISTENT and ESTABLISHED require one DOI string in a claim.


Quickstart

# 1. Init
cd my_project/
mareforma init

# 2. Register a data source
mareforma add-source morphology --path data/morphology/raw/ \
    --description "Neuron skeleton reconstructions"

# 3. Build — classification is automatic
mareforma build

# 4. Inspect the epistemic graph
mareforma trace morphology.features

# 5. Check overall health
mareforma status

# 6. Optional: link a result to literature (unlocks CONSISTENT)
mareforma claim add "Neuron size increases with cortical depth" \
    --source morphology --supports 10.64898/2026.03.05.709819

# 7. Export provenance graph
mareforma export

BuildContext API

Method Description
ctx.source_path("name") Raw data path for a registered source
ctx.save("name", data, fmt=...) Persist artifact (pickle, parquet, csv, numpy)
ctx.load("transform.artifact") Load upstream artifact
ctx.claim("text", supports=[DOI]) Optional: link this run to literature
ctx.log("message") Write to console

CLI reference

Command Description
mareforma init Initialise project
mareforma add-source <name> Register a data source
mareforma check Validate paths and required fields
mareforma build [source] Run the pipeline DAG (--dry-run, --force)
mareforma trace <transform> Ancestry tree with class and support level (--json)
mareforma status Epistemic health dashboard (--json)
mareforma diff <transform> Compare the two most recent runs (--json)
mareforma log Last build status (--json)
mareforma explain [source] Dump project ontology (--json)
mareforma export Write ontology.jsonld
mareforma claim add TEXT Link a result to literature (--supports DOI)
mareforma claim list List claims (--status, --source, --json)
mareforma claim show ID Full claim detail
mareforma claim update ID Update confidence, status, or supports

Project structure

my_project/
├── .mareforma/
│   └── graph.db               ← provenance graph (commit this)
├── mareforma.project.toml     ← project ontology (commit this)
├── claims.toml                ← claims backup, auto-generated (commit this)
├── ontology.jsonld            ← JSON-LD export (commit this)
└── data/
    └── source_name/
        ├── raw/               ← your data
        └── preprocessing/
            └── build_transform.py

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

mareforma-0.2.1.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mareforma-0.2.1-py3-none-any.whl (72.5 kB view details)

Uploaded Python 3

File details

Details for the file mareforma-0.2.1.tar.gz.

File metadata

  • Download URL: mareforma-0.2.1.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for mareforma-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b36df93759ff7cae340a3728d9e26c3e71dccfd0863f88d73fa8498109d3bcd4
MD5 338379786fd4e742a9afe878aae33cff
BLAKE2b-256 55ac05ec1ba8b1799517b80822a8d5fc5b69b56ffa2d3d394a8c9b7840bab16e

See more details on using hashes here.

File details

Details for the file mareforma-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mareforma-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 72.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for mareforma-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3fc102c2ab2104d68f36802a5ea5af1e6099eec4161b4468c16a7a72a5d641b
MD5 ba3532fd865fb6dd0029ea302648b378
BLAKE2b-256 1c9cb76f054180c1aea825d46b2c37ca01c1448ccaa7a3fe454470af43ad3138

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