Skip to main content

elife-crossref-xml-generation

Crossref deposit of journal articles

Overview

elife-crossref-xml-generation creates a Crossref content registration file for a journal article. The registration file is an XML file conforming to the Crossref schema. The code library is used by eLife in its publishing workflow to submit the content registration file by a POST request to the Crossref API endpoint, in order to register DOI values and metadata at Crossref. Following some basic changes to a configuration file, it should be able to generate Crossref content registration files for non-eLife journals.

This library is intended for use by developers, typically integrated into a workflow. There are some options and decisions to make for how you connect it ot your existing workflows, or create an interface to convert individual JATS XML files via a web form, for example.

Supported features

  • DOI

  • article title and basic metadata (volume, issue, pub date, issn, etc.)

  • contributors

  • abstract

  • Fundref

  • AccessIndicators

  • relations (inter_work_relation)

  • text and data mining (TDM) links

  • citation_list

  • components (if you have component DOI values)

Ways to implement it

The data passes through distinct steps, and at these steps the data can be altered if you would like to in your implementation of the library. The default data conversion begins with a JATS XML file, the XML is parsed to extract values into article objects, the article objects are used in a crossrefXML object to construct a Crossref XML representation of the data, and finally the CrossrefXML object can produce XML output.

JATS XML -> article objects -> CrossrefXML object -> Crossref XML output

There are situations you may want to manipulate the data prior to generating Crossref XML. For example, if the article XML is missing a publication date, or you want to specify a version of the article, then you could manipulate the objects in this way before you instantiate the CrossrefXML object.

JATS XML -> article objects -> manipulate the objects -> CrossrefXML object -> Crossref XML output

Another way you can use this library

JATS XML -> article objects -> manipulate the objects -> CrossrefXML object -> Crossref XML output

Install

  1. Install it locally

Clone the git repo

git clone https://github.com/elifesciences/elife-crossref-xml-generation.git

Create a python virtual environment and activate it

virtualenv venv
source venv/bin/activate

Install it locally

pip install -r requirements.txt
pip setup.py install
  1. Or, integrate it into your project

Add to your requirements.txt file of your project a particular commit of this library, for example:

git+https://github.com/elifesciences/elife-crossref-xml-generation.git@288f0bc8d1148eb1795c8ae18a3985d30ba38cd5#egg=elifecrossref

Then you should be able to import the library as elifecrossref.

Configuration

The crossref.cfg file can edited to include your particular values and options. There are some default options, and then a section for each journal to override the default values. Each particular option may support a string, boolean, integer, or list of values. Create a section of your own in the style of [journal_name] and then add the values below it you want to override.

Example usage

In interactive Python, below is an example.

>>> from elifecrossref import generate
>>> articles = generate.build_articles_for_crossref(["tests/test_data/elife-00666.xml"])
>>> articles[0].version = 1
>>> print generate.crossref_xml(articles, "elife")

There are other options in the generate.py file to return the CrossrefXML object created, or to write the output to disk using a single function call.

Contributing to the project

If you have a contribution you would like us to consider, please send a pull request. Open an issues on Github if you get an error. There may be minor changes required to support alternate JATS XML variations. If your XML is open licensed, we may want to add it specifically to the test cases for the project.

License

The MIT License

Metadata

Release files for elifecrossref 0.58.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elifecrossref 0.58.0
File Size Uploaded Provenance Actions
elifecrossref-0.58.0.tar.gz 43.7 kB Without provenance Details for elifecrossref-0.58.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elifecrossref 0.58.0
File Interpreter ABI Platform Actions
elifecrossref-0.58.0-py3-none-any.whl Python 3 none any Details for elifecrossref-0.58.0-py3-none-any.whl

Total release size: 77.8 kB

Release files / elifecrossref-0.58.0.tar.gz

Download URL elifecrossref-0.58.0.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a386e66c5fd4bad2fd2d4f1e513a9bb5e64ea1e7fd0dac5281e7649606dd9255
BLAKE2b-256 checksum
How to use checksums
1eebe49e1c9e8dbbe8264ff96559d443f7ba2a142c6c9a09f4c511e4d379c7ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / elifecrossref-0.58.0-py3-none-any.whl

Download URL elifecrossref-0.58.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5049371e2ece24f83f40ec8f3391901b580366a281c91752a54db1b33ece5664
BLAKE2b-256 checksum
How to use checksums
4b93708efef70fb1ead0b13d4747912db3e3008ba53b57a56d160aafde520453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Security for elifecrossref 0.58.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.58.0 This release

2 release files No provenance

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