proycon / codemetapy

A Python package for generating and working with codemeta
https://codemeta.github.io/
GNU General Public License v3.0
24 stars 5 forks source link

Bug: codemetapy fails to add orcids to all contributors listed in a package.json #45

Closed apirogov closed 11 months ago

apirogov commented 1 year ago

Input package.json:

{
  "name": "somesy",
  "version": "0.1.0",
  "description": "A cli tool for synchronizing CITATION.CFF with project files.",
  "keywords": [
    "metadata",
    "FAIR"
  ],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/Materials-Data-Science-and-Informatics/somesy"
  },
  "homepage": "https://materials-data-science-and-informatics.github.io/somesy",
  "author": {
    "name": "Mustafa Soylu",
    "email": "m.soylu@fz-juelich.de",
    "url": "https://orcid.org/0000-0003-2637-0432"
  },
  "contributors": [
    {
      "name": "Mustafa Soylu",
      "email": "m.soylu@fz-juelich.de",
      "url": "https://orcid.org/0000-0003-2637-0432"
    },
    {
      "name": "Anton Pirogov",
      "email": "a.pirogov@fz-juelich.de",
      "url": "https://orcid.org/0000-0002-5077-7497"
    },
    {
      "name": "Jens Br\u00f6der",
      "email": "j.broeder@fz-juelich.de",
      "url": "https://orcid.org/0000-0001-7939-226X"
    }
  ],
  "main": "index.js",
  "scripts": {
    "test": "echo \"No tests available\""
  },
  "dependencies": {
    "lodash": "^4.17.21",
    "axios": "^0.21.1"
  },
  "devDependencies": {
    "jest": "^27.0.6"
  }
}

Resulting codemeta.json:

[...]
    "contributor": [
        {
            "@type": "Person",
            "email": "m.soylu@fz-juelich.de",
            "familyName": "Soylu",
            "givenName": "Mustafa",
            "url": "https://orcid.org/0000-0003-2637-0432"
        },
        {
            "@type": "Person",
            "email": "a.pirogov@fz-juelich.de",
            "familyName": "Pirogov",
            "givenName": "Anton"
        },
        {
            "@type": "Person",
            "email": "j.broeder@fz-juelich.de",
            "familyName": "Bröder",
            "givenName": "Jens"
        }
    ],
[...]

So the ORCID / Url is not preserved except for the first listed contributor.

proycon commented 11 months ago

Sorry for the long delay (I was off for a while during the summer/holiday period). This indeed looks like a clear bug in the package.json parsing, or conversion afterwards. I will investigate further.

proycon commented 11 months ago

Fixed and released now