Guide

Build PyPI version docs GitHub

commonmeta-py is a Python library to implement commonmeta, the metadata format for common scholarly metadata. Use commonmeta-py to convert scholarly metadata from/to a variety of metadata formats, listed below. Commonmeta-py is work in progress, the first release on PyPi (version 0.5.0) was on February 16, 2023. Up until version 0.5.1, the library was called talbot. Commonmeta-py is modelled after the briard ruby gem.

Installation

Stable version

pip (or pip3) install commonmeta-py

Dev version

pip install git+https://github.com/front-matter/commonmeta-py.git#egg=commonmeta-py

Testing

commonmeta-py uses pytest and vcrpy for testing. To run the tests, issue one of the following commands from the root folder:

All tests:

pytest

All tests in a test file, e.g. tests/test-utils.py:

pytest tests/test-utils.py

Run a specific test e.g. test_datacite_api_url in tests/test-utils.py:

pytest tests/test-utils.py -k 'test_datacite_api_url'

vcrpyrecords HTTP requests to speed up testing.

Supported Formats

Commometa-py reads and/or writes these metadata formats:

Format Name Content Type Read Write
Commonmeta commonmeta application/vnd.commonmeta+json yes yes
CrossRef Unixref XML crossref_xml application/vnd.crossref.unixref+xml yes yes
Crossref crossref application/vnd.crossref+json yes n/a
DataCite XML datacite_xml application/vnd.datacite.datacite+xml yes no
DataCite datacite application/vnd.datacite.datacite+json yes yes
Schema.org (in JSON-LD) schema_org application/vnd.schemaorg.ld+json yes yes
RDF XML rdf_xml application/rdf+xml no later
RDF Turtle turtle text/turtle no later
CSL-JSON csl pplication/vnd.citationstyles.csl+json yes yes
Formatted text citation citation text/x-bibliography n/a yes
Codemeta codemeta application/vnd.codemeta.ld+json yes later
Citation File Format (CFF) cff application/vnd.cff+yaml yes later
JATS jats application/vnd.jats+xml later later
CSV csv text/csv no later
BibTex bibtex application/x-bibtex later yes
RIS ris application/x-research-info-systems yes yes
InvenioRDM inveniordm application/vnd.inveniordm.v1+json later yes
JSON Feed json_feed_item application/feed+json yes later

commonmeta: the Commonmeta format is the native format for the library and used internally. Planned: we plan to implement this format for the v1.0 public release.
Later: we plan to implement this format in a later release.