CFF Reader

This notebook shows how to read metadata in Citation File Format (CFF).

Fetch the metadata

from commonmeta import Metadata
# Fetch metadata from a GitHub repository that contains a CITATION.cff file
string = ''
metadata = Metadata(string)

# Check that metadata was fetched successfully

Inspect the metadata

The following metadata are required for each Crossref resource:

  • id: the persistent identifier of the resource (e.g. a DOI or repository URL)
  • type: the type of the resource in commonmeta format, for CFF it is always Software
  • url: the URL of the resource, typically a code repository URL
  • titles: the title(s) of the resource
  • creators: the creator(s)/author(s) of the resource
  • publisher: the publisher of the resource
  • publication_year: the publication year of the resource

In addition, there are plenty of optional metadata. They are converted into the internal commonmeta format.

commonmeta = metadata.write()
    "id": "",
    "type": "Software",
    "url": "",
    "contributors": [
            "id": "",
            "type": "Person",
            "givenName": "Kaizhao",
            "familyName": "Liang"
    "titles": [
            "title": "Long Context Transformer v0.0.1"
    "publisher": {
        "name": "GitHub"
    "date": {
        "published": "2023-02-17"
    "version": "0.0.1",
    "provider": "DataCite"