CLI

python -m mecadoi

python -m mecadoi [OPTIONS] COMMAND [ARGS]...

batch

Create DOIs for peer reviews and author replies in MECA archives.

All actions taken during these commands are recorded in the MECADOI database. Its location can be set through the DB_URL parameter in the .env file.

python -m mecadoi batch [OPTIONS] COMMAND [ARGS]...

deposit

Create DOIs for MECA archives in the MECADOI database.

The command finds those MECA archives in the MECADOI database for which DOIs can be deposited, i.e. those that have reviews and a preprint DOI and for which no deposition has been attempted yet. Then a deposition attempt is made for each selected MECA and its result recorded in the MECADOI database. Information about each successful deposition attempt is written to a file in –output-dir.

DOIs are deposited by sending an XML file conforming to the Crossref metadata schema to the Crossref API. Emails with detailed information about the status of every submission is sent to the depositor’s email address, which is taken from the DEPOSITOR_EMAIL variable in your .env file. Failures in the deposition data (e.g. malformed DOIs) are only reported in this email, i.e. this command almost always executes successfully.

Before a deposition is attempted the DOIs to be created are verified against the EEB platform (eeb.embo.org). If any review or reply already has a DOI, or if the amount of reviews and replies don’t match exactly, the attempt is marked as failed.

The ID of this command invocation and a list of all processed MECA archives is printed to stdout. The MECA archives are grouped by their status:

- deposition_generation_failed if the Crossref XML file could not be generated
- dois_already_present if at least one review or reply in the MECA archive already has a DOI
- deposition_verification_failed if the reviews and replies in the MECA archive don’t exactly match those on EEB
- deposition_succeeded if the deposition XML was accepted by the Crossref API
- deposition_failed if the deposition XML was not accepted by or could not be sent to the Crossref API

NOTE: By default, this command will not create any DOIs or update the MECADOI database. Pass the –no-dry-run option to actually execute the irreversible deposition and update the database.

python -m mecadoi batch deposit [OPTIONS]

Options

-o, --output-dir <output_dir>

Required The directory to which a file with information about successful deposition attempts is written.

--dry-run, --no-dry-run

Only show what would happen / actually create DOIs and update the database. DEFAULT: –dry-run

--retry-failed, --no-retry-failed

Re-try DOI deposition for MECA archives for which a previous attempt has failed / deposit DOIs for MECA archives without deposition attempt. DEFAULT: –no-retry-failed

-a, --after <after>

Only attempt to deposit DOIs for MECA archives that were received after this date. Example: 2022-04-01

-b, --before <before>

Only attempt to deposit DOIs for MECA archives that were received before this date. Example: 2022-10-01

parse

Import files into the MECADOI database.

The command archives all files in INPUT_DIR to a new folder in –output-dir, tries to parse them as MECA archives, and registers them in the MECADOI database.

The processed files are moved to a subfolder named parsed/<id>/ within –output-dir, where <id> is the unique ID generated for this command invocation.

The ID of this command invocation and a list of all processed files is printed to stdout. The files are grouped by their status:

- invalid for files that are not MECA archives (e.g. non-ZIP files)
- no_reviews for MECA archives that contain no reviews or author replies
- no_preprint_doi for MECA archives that contain no preprint DOI (required for DOI creation)
- ready_for_deposition for MECA archives where review and author reply DOIs can be created
python -m mecadoi batch parse [OPTIONS] INPUT_DIR

Options

-o, --output-dir <output_dir>

Required The directory to which processed files will be archived. Must be an existing directory.

Arguments

INPUT_DIR

Required argument

prune

Delete MECA archives that are no longer needed for deposition.

All MECA archives are parsed during the initial import and all information necessary for DOI creation is stored in the MECADOI database. After this step, the actual file on disk is no longer needed to create DOIs.

This command checks the file path of every MECA archive registered in the MECADOI database and deletes those files that exist on disk.

NOTE: By default, this command will not delete any files. Pass the –no-dry-run option to actually execute the deletions.

python -m mecadoi batch prune [OPTIONS]

Options

--dry-run, --no-dry-run

Only show what would happen / actually delete MECA archives. DEFAULT: –dry-run

meca

Read information from a MECA archive.

python -m mecadoi meca [OPTIONS] COMMAND [ARGS]...

info

Show basic information about the manuscript in a MECA archive.

Parses the file at MECA_ARCHIVE and prints the authors, journal, title, any DOIs, and a summary of the peer review process of the manuscript to stdout.

python -m mecadoi meca info [OPTIONS] MECA_ARCHIVE

Arguments

MECA_ARCHIVE

Required argument

reviews

Show information about the review process of the manuscript in a MECA archive.

Parses the file at MECA_ARCHIVE and prints the authors, date, and a summary of all reviews and author replies of the manuscript to stdout.

python -m mecadoi meca reviews [OPTIONS] MECA_ARCHIVE

Arguments

MECA_ARCHIVE

Required argument