opcit


Nameopcit JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://gitlab.com/crossref/labs/opcit
SummaryA plugin for Crossref's Labs API that handles digital preservation on Crossref deposits.
upload_time2024-02-26 15:54:37
maintainer
docs_urlNone
authorMartin Paul Eve
requires_python>=3.8
license
keywords digital-preservation academic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Project Op Cit
This is a plugin for the [Crossref Labs API](https://gitlab.com/crossref/labs/lambda-api-proxy) that allows for the automatic digital preservation deposit of incoming XML.

![Op Cit Logo](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/logo-large.png)

![license](https://img.shields.io/gitlab/license/crossref/labs/opcit) ![activity](https://img.shields.io/gitlab/last-commit/crossref/labs/opcit) <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>

![FastAPI](https://img.shields.io/badge/fastapi-%23092E20.svg?style=for-the-badge&logo=fastapi&logoColor=white) ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

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](https://gitlab.com/crossref/labs/longsight).

## Background
[Project Op Cit](https://www.crossref.org/blog/a-request-for-comment-automatic-digital-preservation-and-self-healing-dois/) 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](https://gitlab.com/crossref/chooser) for [multiple resolution](https://www.crossref.org/documentation/register-maintain-records/creating-and-managing-dois/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](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/deposit-process-blog.png)

![Op Cit Workflow](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/resolution-process-blog.png)

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](https://crossref.gitlab.io/knowledge_base/docs/services/xml-deposit-synchronous-2/).

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
* [FastAPI](https://fastapi.tiangolo.com/) for the Crossref Labs API.
* [Git](https://git-scm.com/) from Linus Torvalds _et al_.
* [.gitignore](https://github.com/github/gitignore) from Github.

&copy; Crossref 2023

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/crossref/labs/opcit",
    "name": "opcit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Martin Paul Eve <meve@crossref.org>",
    "keywords": "digital-preservation,academic",
    "author": "Martin Paul Eve",
    "author_email": "meve@crossref.org",
    "download_url": "https://files.pythonhosted.org/packages/21/52/6c56288d16c13f0c9a5af21536a9e3a3e2b1ac4a05ce0887e24bea8e08c0/opcit-0.1.3.tar.gz",
    "platform": null,
    "description": "# Project Op Cit\nThis is a plugin for the [Crossref Labs API](https://gitlab.com/crossref/labs/lambda-api-proxy) that allows for the automatic digital preservation deposit of incoming XML.\n\n![Op Cit Logo](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/logo-large.png)\n\n![license](https://img.shields.io/gitlab/license/crossref/labs/opcit) ![activity](https://img.shields.io/gitlab/last-commit/crossref/labs/opcit) <a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\n\n![FastAPI](https://img.shields.io/badge/fastapi-%23092E20.svg?style=for-the-badge&logo=fastapi&logoColor=white) ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)\n\nThe application examines incoming XML deposits, checks for openly licensed material, and deposits it in an extensible range of digital preservation archives.\n\n## Installation\nThe easiest install is via pip:\n    \n    pip install opcit\n\nThe entry point is the main deposit function, which takes a StarletteRequest object and a [longsight Instrumentation logging object](https://gitlab.com/crossref/labs/longsight).\n\n## Background\n[Project Op Cit](https://www.crossref.org/blog/a-request-for-comment-automatic-digital-preservation-and-self-healing-dois/) 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.\n\nThe workflow for the application is as follows:\n\n1. The Crossref Labs API receives a deposit request.\n2. The Crossref Labs API calls the `deposit` function in the `opcit` package.\n3. The `deposit` function checks the incoming XML for openly licensed material.\n4. If openly licensed material is found, the `deposit` function deposits the material in a digital preservation archive.\n5. 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](https://gitlab.com/crossref/chooser) for [multiple resolution](https://www.crossref.org/documentation/register-maintain-records/creating-and-managing-dois/multiple-resolution/). An example of such a landing page can be seen at https://doi.org/10.32013/12345678-23.\n6. The Crossref Labs API returns a response to the original deposit request.\n\nThis can be visualized as follows:\n\n![Op Cit Workflow](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/deposit-process-blog.png)\n\n![Op Cit Workflow](https://gitlab.com/crossref/labs/opcit/-/raw/main/opcit/logo/resolution-process-blog.png)\n\nAt 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.\n\n## Usage\n\nFirst, 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:\n\n```\n<collection property=\"crawler-based\">\n    <item crawler=\"iParadigms\">\n        <resource mime_type=\"application/pdf\">https://eprints.bbk.ac.uk/id/eprint/26645/1/9780198850489.pdf</resource>\n    </item>\n</collection>\n```\n\nSecond, 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:\n\n```\n<program xmlns=\"http://www.crossref.org/AccessIndicators.xsd\">\n    <free_to_read/>\n    <license_ref applies_to=\"vor\" start_date=\"2022-01-01\">https://creativecommons.org/licenses/by/4.0/</license_ref>\n</program>\n```\n\nFinally, 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/.\n\nPOST requests to this URL should conform to [the synchronous deposit API guidelines](https://crossref.gitlab.io/knowledge_base/docs/services/xml-deposit-synchronous-2/).\n\nPlease 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.\n\n## Disclaimers\nThis 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.\n\n# Credits\n* [FastAPI](https://fastapi.tiangolo.com/) for the Crossref Labs API.\n* [Git](https://git-scm.com/) from Linus Torvalds _et al_.\n* [.gitignore](https://github.com/github/gitignore) from Github.\n\n&copy; Crossref 2023\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A plugin for Crossref's Labs API that handles digital preservation on Crossref deposits.",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://gitlab.com/crossref/labs/opcit",
        "changelog": "https://gitlab.com/crossref/labs/opcit/-/blob/main/CHANGELOG.md",
        "documentation": "https://labs.crossref.org",
        "homepage": "https://labs.crossref.org",
        "repository": "https://gitlab.com/crossref/labs/opcit"
    },
    "split_keywords": [
        "digital-preservation",
        "academic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c93789bc7d71a02e3c2a42c4b354943cbbd6437fa8af78da98e1e25377810727",
                "md5": "77b9f7656c6d9333cd01feec01aa9e2a",
                "sha256": "afa87c4824640e3697c965d90441f4daa89005396bb859da7f6b449f99aaac29"
            },
            "downloads": -1,
            "filename": "opcit-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "77b9f7656c6d9333cd01feec01aa9e2a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24584,
            "upload_time": "2024-02-26T15:54:34",
            "upload_time_iso_8601": "2024-02-26T15:54:34.602019Z",
            "url": "https://files.pythonhosted.org/packages/c9/37/89bc7d71a02e3c2a42c4b354943cbbd6437fa8af78da98e1e25377810727/opcit-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21526c56288d16c13f0c9a5af21536a9e3a3e2b1ac4a05ce0887e24bea8e08c0",
                "md5": "e4b478ac59a751e0de6fe2ff83b29870",
                "sha256": "07d6549ab3c5e0a2ad657fa21e14ee819a9fa16d5dcd7df1eb132f06fb412352"
            },
            "downloads": -1,
            "filename": "opcit-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e4b478ac59a751e0de6fe2ff83b29870",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24881,
            "upload_time": "2024-02-26T15:54:37",
            "upload_time_iso_8601": "2024-02-26T15:54:37.361788Z",
            "url": "https://files.pythonhosted.org/packages/21/52/6c56288d16c13f0c9a5af21536a9e3a3e2b1ac4a05ce0887e24bea8e08c0/opcit-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 15:54:37",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "crossref",
    "gitlab_project": "labs",
    "lcname": "opcit"
}
        
Elapsed time: 0.22504s