Package: opcit
Project Op CitThis is a plugin for theCrossref Labs APIthat allows for the automatic digital preservation deposit of incoming XML.The application examines incoming XML deposits, checks for openly licensed material, and deposits it in an extensible range of digital preservation archives.InstallationThe easiest install is via pip:pip install opcitThe entry point is the main deposit function, which takes a StarletteRequest object and alongsight Instrumentation logging object.BackgroundProject Op Citisan experimental technologythat  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:The Crossref Labs API receives a deposit request.The Crossref Labs API calls thedepositfunction in theopcitpackage.Thedepositfunction checks the incoming XML for openly licensed material.If openly licensed material is found, thedepositfunction deposits the material in a digital preservation archive.Thedepositfunction 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 triggersChooserformultiple resolution. An example of such a landing page can be seen athttps://doi.org/10.32013/12345678-23.The Crossref Labs API returns a response to the original deposit request.This can be visualized as follows: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.UsageFirst, ensure that your XML contains a<resource>tag with amimetypeattribute and afilenamevalue. Themimetypeattribute should contain the MIME type of the file (bearing in mind that only PDFs will be preserved), and thefilenamevalue 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 aapplies_toattribute and ahrefvalue. Theapplies_toattribute should contain the version of the file to which the license applies, and thehrefvalue 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 athttps://api.crossref.org/deposit/preserve/.POST requests to this URL should conform tothe 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.DisclaimersThis 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.CreditsFastAPIfor the Crossref Labs API.Gitfrom Linus Torvaldset al..gitignorefrom Github.© Crossref 2023