Skip to main content

DOI Build PyPI version Coverage Maintainability Rating docs GitHub

commonmeta-py

commonmeta-py is a Python library to implement Commonmeta, the common Metadata Model for Scholarly Metadata. Use commonmeta-py to convert scholarly metadata, in a variety of formats, listed below. 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 is also available as a Rust library commonmeta-rs.

commonmeta-py uses semantic versioning. Currently, its major version number is still at 0, meaning the API is not yet stable, and breaking changes are expected in the internal API and commonmeta JSON format.

Installation

Add commonmeta-py as a library dependency to your project:

uv add commonmeta-py

To use the commonmeta command-line tool, install it globally with uv instead:

uv tool install commonmeta-py

This makes commonmeta available on your PATH. Upgrade it later with uv tool upgrade commonmeta-py, or remove it with uv tool uninstall commonmeta-py.

Supported Metadata 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 XML crossref_xml application/vnd.crossref.unixref+xml yes yes
Crossref crossref application/vnd.crossref+json yes yes
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 application/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 yes yes
RIS ris application/x-research-info-systems yes yes
InvenioRDM inveniordm application/vnd.inveniordm.v1+json yes yes
JSON Feed jsonfeed application/feed+json yes later
OpenAlex openalex yes no

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.

Command-line interface

Installing commonmeta-py provides a commonmeta command with the subcommands convert, list, put, push, encode, and decode.

You can also run the CLI without installing anything, using uv. Because the package name (commonmeta-py) differs from the command name (commonmeta), pass it with --from:

uvx --from commonmeta-py commonmeta convert 10.5555/12345678 --to csl

The examples below use commonmeta ...; prefix them with uvx --from commonmeta-py to run the same commands without installing.

# Encode/decode a Crockford base32 identifier suffix given a DOI prefix
commonmeta encode 10.5555
commonmeta decode 10.5555/nwbyp-29t86

# Convert a single record between formats, fetching it by DOI
# (--from is auto-detected from a DOI/URL, so it can usually be omitted)
commonmeta convert 10.5555/12345678 --to csl

# Convert a local file and write the result to disk
commonmeta convert record.json --from commonmeta --to csl --file out.json

# Render a formatted citation (CSL style + locale)
commonmeta convert 10.5555/12345678 --to citation --style apa --locale en-US

# Convert to Crossref XML, DataCite JSON, schema.org, BibTeX, or RIS
commonmeta convert 10.5555/12345678 --to crossref_xml
commonmeta convert 10.5555/12345678 --to datacite

# Convert a list of records from a local JSON/JSONL file
commonmeta list records.json --to bibtex --file out.bib

# Read a VRAIX daily dump and convert it (the --from value is the source)
commonmeta list --from crossref --date 2026-06-15 --to commonmeta --file out.json

# Fetch a batch of random records from an API (crossref, datacite, or openalex)
commonmeta list --sample --from crossref --number 5

# Register records with a live InvenioRDM instance (creates/updates and publishes
# real records — registration is currently only supported with --to inveniordm)
commonmeta push records.json --to inveniordm --host rogue-scholar.org --token TOKEN

# Same as push, but for a single record (DOI, URL, or file path)
commonmeta put 10.5555/12345678 --from crossref --to inveniordm --host rogue-scholar.org --token TOKEN

# Work fully offline — fails fast if a network call would be required
commonmeta convert record.json --from commonmeta --to csl --no-network

Use commonmeta <subcommand> --help for the full list of options. --from/-f sets the input format (auto-detected when omitted) and --to/-t the output format. JSON output (commonmeta, datacite, schema_org, crossref, inveniordm, csl) is pretty-printed; use --file to write to disk instead of stdout.

convert and list accept --no-network: any step that would make an outbound request (fetching a DOI/URL, --sample, or downloading a VRAIX dump) fails immediately with a clear message, while operations on local files always succeed. push and put always require network access.

Documentation

Documentation (work in progress) for using the library is available at the commonmeta-py Documentation website.

Meta

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License: MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commonmeta_py-0.255.tar.gz (438.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commonmeta_py-0.255-py3-none-any.whl (493.1 kB view details)

Uploaded Python 3

File details

Details for the file commonmeta_py-0.255.tar.gz.

File metadata

  • Download URL: commonmeta_py-0.255.tar.gz
  • Upload date:
  • Size: 438.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for commonmeta_py-0.255.tar.gz
Algorithm Hash digest
SHA256 b62fa37c9e4d170bf680ce9beb06a3698aab4b495a49fe483cc15395f3d05905
MD5 9c28be2b02f37c9dece7333a84e98f3c
BLAKE2b-256 b4dca3b039bbd87a884bef8826bcdc05eb2cf299451675e37827723c8f1965f1

See more details on using hashes here.

File details

Details for the file commonmeta_py-0.255-py3-none-any.whl.

File metadata

  • Download URL: commonmeta_py-0.255-py3-none-any.whl
  • Upload date:
  • Size: 493.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for commonmeta_py-0.255-py3-none-any.whl
Algorithm Hash digest
SHA256 513a22a51b5e6a8cf54a35109065b8f11f71f09619e9b9c0e10be7b29de8a83a
MD5 4e70158e60dc44507635079a141948c8
BLAKE2b-256 e4b4fa8a647f47e2a249a656cdb89c927563f4019ad20b9439a0310bcf981109

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page