Skip to main content

ReproFig

ReproFig makes a figure carry the exact comma-separated values (CSV), optional statistics, software version, source fingerprints, and reproduction instructions needed to audit it later. It works for general data figures; scientific figures and publication workflows are the main use case because their evidence and reporting requirements benefit most. The same reprofig/1 record works in SVG, PDF, PNG, JPEG, TIFF, WebP, AVIF/HEIF, PowerPoint, Word, Excel, HTML, HDF5, netCDF-4, FITS, and deterministic ZIP/RO-Crate bundles.

python -m pip install reprofig

ReproFig requires Python 3.10 or newer. The core has no required scientific stack. The main installation choices are:

python -m pip install reprofig           # ordinary save, embed, inspect, extract
python -m pip install "reprofig[excel]"  # publication workbooks
python -m pip install "reprofig[proof]"  # workbooks, statistics, visuals, signatures, encryption

Carrier-specific extras remain available for PDF, HEIF, HDF5, netCDF and FITS.

Create a master figure

from reprofig import save_figure

save_figure(
    figure,
    "Figure 1.pdf",
    plotted_data=dataframe,
    statistics=records,
    producer={"package": "my-analysis", "version": "1.4.0"},
    figure_profile="master",
)

This ordinary workflow is unchanged and does not activate proof checks, cryptography, interception, or extra dependencies.

A master embeds the exact CSV bytes used for the plot. This is the auditable source of truth and may contain private data or local paths, so do not upload it without checking it first. Sidecar files are optional and can be regenerated:

from reprofig import extract_artifact, publish_artifacts

extract_artifact("Figure 1.pdf", "Figure 1 extracted")
publish_artifacts(
    ["Figure 1.pdf", "Figure 2.jpg", "Slides.pptx"],
    output_dir="Publication",
    figure_profile="public",
    safe_columns=["condition", "value"],
)

Integrate another plotting package

Attach the plot meaning before its normal save step:

from reprofig import attach, save_figure

attach(
    figure,
    plotted_data=analysis_rows,
    statistics=statistical_records,
    analysis={"independent_unit": "participant"},
    column_classification={
        "condition": "safe",
        "value": "safe",
        "participant_id": "private",
    },
)
save_figure(
    figure,
    "Figure.png",
    producer={"package": "my-analysis", "package_version": "2.1.0"},
    render_preset="line_art",
)

New raster figures default to 300 dots per inch (DPI). Use screen for 150 DPI, continuous_tone for 300 DPI, line_art for 600 DPI, or pass an exact dpi, width, and height. Existing raster files are never resampled by embed_file; AVIF/HEIF metadata changes require allow_reencode=True because the available backend must rebuild those images.

Make publication-safe copies

The public profile retains only explicitly approved columns and source links. The minimal_public profile retains summary statistics and provenance without row-level data. Both are one-way derivatives of the master:

reprofig publish Figure.svg Figure.jpg --output-dir Submission \
  --profile minimal-public --safe-columns condition,value \
  --public-source dataset=https://repository.example/data.csv

The command-line interface also provides formats, inspect, validate, embed, extract, caption, scan, bundle, and fsb-export. Run reprofig formats to see optional dependencies and carrier capabilities.

Embedded metadata can be stripped by editors, social platforms, publisher pipelines, or format conversion. Keep the master. When the delivery route is unknown, send a .reprofig.zip bundle alongside the visible figure; its fixed layout and SHA-256 checksums make missing or changed files detectable.

Build a publication source-data workbook

Combine every unique embedded CSV with a normalized table of all plotted and unplotted tests:

from reprofig import build_publication_workbook

result = build_publication_workbook(
    "figures/",
    "Publication-source-data.xlsx",
    experiment_statistics="analysis/all-tests.json",
)

Set the ledger's coverage to analysis_complete only when it intentionally lists every analysis, including unplotted tests. That is a declaration, not proof that undisclosed analyses never occurred. See docs/publication_workbook.md.

Opt into proof-carrying output

from reprofig import bind_artist, save_figure, verify_proof

bind_artist(line, semantic_id="treated-series", columns=["time", "signal"])
save_figure(
    figure,
    "Figure-1.svg",
    plotted_data=rows,
    statistics=statistics,
    proof=True,
)
report = verify_proof(
    "Figure-1.svg",
    required=["internally_consistent", "display_verified"],
)

Complete figure reproduction is deliberately separate because it executes the embedded producer. It saves a second carrier and a report; later verification only reads those files and never reruns code:

from reprofig import reproduce_figure

run = reproduce_figure(
    "Figure-1.svg",
    bundle_root="figure-bundle",
    output_dir="figure-bundle/verification/reproduced",
    execute_trusted_producer=True,
)

Use statistics_reproduced when declared statistics match the same implementation, statistics_independently_verified when a separate reference implementation matches, and figure_reproduced only when a separately saved figure also matches. See docs/figure-reproduction.md.

Typed statistical specifications can additionally reconstruct declared source transformations and recalculate supported tests. A passing report proves that the stated evidence agrees with the output; it does not prove that source data are true or that the chosen method is scientifically appropriate.

Signatures answer “has this evidence changed since this key signed it?” Trust stores separately answer “do I accept that key for this purpose?” Individual tables, statistics, provenance, or specifications can be encrypted for a password or named X25519 recipient before signing. See docs/proof-carrying-verification.md and docs/security.md.

Develop and verify

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*

Report problems through the GitHub issue tracker. Please cite ReproFig using the metadata in CITATION.cff.

ReproFig is licensed under the BSD 3-Clause licence.

Release files for reprofig 0.4.0

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

Source distribution (sdist)

Source distribution for reprofig 0.4.0
File Size Uploaded
reprofig-0.4.0.tar.gz 139.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reprofig 0.4.0
File Interpreter ABI Platform
reprofig-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 317.9 kB

Release files / reprofig-0.4.0.tar.gz

Download URL reprofig-0.4.0.tar.gz
Size 139.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ab1d7b0debf8940c9cee657809e4c37b9fa18ecd419013fbebb077a4f4e8f86
BLAKE2b-256 checksum
How to use checksums
1063bf271b596d239345564d6ac7131fb5ee4dec6b185ddf3071626502eed669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

Release files / reprofig-0.4.0-py3-none-any.whl

Download URL reprofig-0.4.0-py3-none-any.whl
Size 178.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3b9d320d8254f9a50151d7bfc2d9abd75ba176fb208ed91f958685176d69dd7
BLAKE2b-256 checksum
How to use checksums
aec563f9f27b5940330e54ee8c42489bbe8678c36d977fe446f55173c3d17ad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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