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.266.tar.gz (464.5 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.266-py3-none-any.whl (525.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commonmeta_py-0.266.tar.gz
  • Upload date:
  • Size: 464.5 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.266.tar.gz
Algorithm Hash digest
SHA256 cb03392e3367aefc5f3b1b44451b13435bf44f95dd40ab2e3bbada72489993b7
MD5 1824ede62fe9e651e5ec62b0dfec2618
BLAKE2b-256 d54e7d2175b2357884fc75025ce6a033ee642500c4c838a06c356d1550b52df3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: commonmeta_py-0.266-py3-none-any.whl
  • Upload date:
  • Size: 525.0 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.266-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f0735d765d40ff0fc53402e759baef7542db2120b5152ff83c1c379e06c7f5
MD5 f9fa1f37e8c671cd8fdd35978b5e6aa5
BLAKE2b-256 476ecef809f812f8f546cdac315405a53246e4f6a72c48a377df77daac43eea7

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