Skip to main content

A plugin for Crossref's Labs API that handles digital preservation on Crossref deposits.

Project description

Project Op Cit

This is a plugin for the Crossref Labs API that allows for the automatic digital preservation deposit of incoming XML.

Op Cit Logo

license activity Code style: black

FastAPI Git GitHub Linux Python

The application examines incoming XML deposits, checks for openly licensed material, and deposits it in an extensible range of digital preservation archives.

Installation

The easiest install is via pip:

pip install opcit

The entry point is the main deposit function, which takes a StarletteRequest object and a longsight Instrumentation logging object.

Background

Project Op Cit is an experimental technology that replaces the conventional Crossref deposit workflow with a new process that includes digital preservation. The application is designed to be called from the Crossref Labs API, and is not intended to be run as a standalone application.

The workflow for the application is as follows:

  1. The Crossref Labs API receives a deposit request.
  2. The Crossref Labs API calls the deposit function in the opcit package.
  3. The deposit function checks the incoming XML for openly licensed material.
  4. If openly licensed material is found, the deposit function deposits the material in a digital preservation archive.
  5. The deposit function returns a response to the Crossref Labs API, which replaces the user's resource URL with an additional resource URL for the preserved version. This triggers Chooser for multiple resolution. An example of such a landing page can be seen at https://doi.org/10.32013/12345678-23.
  6. The Crossref Labs API returns a response to the original deposit request.

This can be visualized as follows:

Op Cit Workflow

Op Cit Workflow

At present, Op Cit will only preserve PDF files that are specified in the XML under the <resource> element tag. The application will not preserve any other file types, and will not preserve any files that are not specified in the XML.

Usage

First, ensure that your XML contains a <resource> tag with a mimetype attribute and a filename value. The mimetype attribute should contain the MIME type of the file (bearing in mind that only PDFs will be preserved), and the filename value should contain the URL of the file. For example:

<collection property="crawler-based">
    <item crawler="iParadigms">
        <resource mime_type="application/pdf">https://eprints.bbk.ac.uk/id/eprint/26645/1/9780198850489.pdf</resource>
    </item>
</collection>

Second, ensure that your XML contains a <license> tag with a applies_to attribute and a href value. The applies_to attribute should contain the version of the file to which the license applies, and the href value should contain the URL of the license. Only openly licensed material (using a Creative Commons license) will be deposited. For example:

<program xmlns="http://www.crossref.org/AccessIndicators.xsd">
    <free_to_read/>
    <license_ref applies_to="vor" start_date="2022-01-01">https://creativecommons.org/licenses/by/4.0/</license_ref>
</program>

Finally, repoint your deposit request to the Op Cit API. The API will return a response with the new URL of the resource, which will trigger multiple resolution and Chooser. The live version of the prototype deposit API can be found at https://api.crossref.org/deposit/preserve/.

POST requests to this URL should conform to the synchronous deposit API guidelines.

Please note that Op Cit is not suitable for mass deposits, and is intended for use with individual or small deposits only. Those making larger deposits should continue to use the XML deposit API.

Disclaimers

This is an experimental technology without guarantee of uptime or reliability and is not intended for production use. The application is not intended to be run as a standalone application, and is designed to be called from the Crossref Labs API. The application is not intended to be used for mass deposits, and is intended for use with individual or small deposits only. Those making larger deposits should continue to use the XML deposit API.

Credits

© Crossref 2023

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

opcit-0.1.3.tar.gz (24.9 kB view hashes)

Uploaded Source

Built Distribution

opcit-0.1.3-py3-none-any.whl (24.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page