Skip to main content

rocrate-action-recorder

PyPI DOI Research Software Directory Badge github repo badge github license badge CI readthedocs

Python package to record calls of Python CLI commands into a Research Object Crate (RO-Crate). Useful to track which commands were executed, which files were used as input or output, and which software was used to execute the command.

Supports RO-Crate 1.1 specification. Specifically the Process Run Crate profile.

Provides adapters for CLIs based on:

Install

pip install rocrate-action-recorder

For Click support, install the optional extra:

pip install "rocrate-action-recorder[click]"

For Cyclopts support, install the optional extra:

pip install "rocrate-action-recorder[cyclopts]"

Usage

Example of recording a CLI command (example-cli input.txt output.txt) implemented with argparse.

import argparse
from pathlib import Path
import sys

from rocrate_action_recorder import recorded_argparse

parser = argparse.ArgumentParser(prog="example-cli", description="Example CLI")
parser.add_argument("--version", action="version", version="%(prog)s 1.2.3")
parser.add_argument("--no-record", action="store_false", help="Disable RO-Crate recording.")
parser.add_argument("input", type=Path, help="Input file")
parser.add_argument("output", type=Path, help="Output file")


@recorded_argparse(
    parser=parser,
    input_files=["input"],
    output_files=["output"],
    dataset_license="CC-BY-4.0",
    enabled_argument="no_record",
)
def handler(args: argparse.Namespace):
    # For demonstration, just upper case input to output, replace with real logic
    args.output.write_text(args.input.read_text().upper())


# Prepare input
Path("input.txt").write_text("hello")
# Simulate command-line arguments
sys.argv.extend(["input.txt", "output.txt"])

args = parser.parse_args()
handler(args)

After execution, a ro-crate-metadata.json file (like this one) will be generated in the current working directory, describing the execution of the CLI command.

You can also call the low-level record function directly.

See documentation for more details.

Contributions

See AGENTS.md for commands and hints for contributions.

Citation

See CITATION.cff for citation information.

Metadata

Release files for rocrate-action-recorder 0.8.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 rocrate-action-recorder 0.8.1
File Size Uploaded Provenance Actions
rocrate_action_recorder-0.8.1.tar.gz 94.1 kB With provenance Details for rocrate_action_recorder-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rocrate-action-recorder 0.8.1
File Interpreter ABI Platform Actions
rocrate_action_recorder-0.8.1-py3-none-any.whl Python 3 none any Details for rocrate_action_recorder-0.8.1-py3-none-any.whl

Total release size: 124.6 kB

Release files / rocrate_action_recorder-0.8.1.tar.gz

Download URL rocrate_action_recorder-0.8.1.tar.gz
Size 94.1 kB
Tags Source
SHA-256 checksum
How to use checksums
34e1ddf155d2146a02ee15d0ce927b2388be8b190b613110090ec2278fd0655b
BLAKE2b-256 checksum
How to use checksums
16f3526984c44c1e13c1cdb93579044fe8260ac2649ed6c739275ff949e87b38
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 Oct 21, 2026.

Transparency log

Release files / rocrate_action_recorder-0.8.1-py3-none-any.whl

Download URL rocrate_action_recorder-0.8.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69f241ef5484f13489a08f19b4a31a48ac107d52edff3e03b61875e35f791c38
BLAKE2b-256 checksum
How to use checksums
95aac19a5905281333e106af08be2382bc9f92b5df007e535726ee7295e35b55
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 Oct 21, 2026.

Transparency log

Security for rocrate-action-recorder 0.8.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 rocrate_action_recorder-0.8.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 Oct 21, 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.

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