citation-file-format / doi2cff

Generate a CFF file using the metadata from a software release on Zenodo.
Apache License 2.0
21 stars 4 forks source link

Doi2cff fails for any DOI I tried #10

Open tillea opened 5 years ago

tillea commented 5 years ago

Description

I'm trying to build a Debian package from doi2cff. The usage example

doi2cff init https://doi.org/10.5281/zenodo.1149011

works. However, if I try random other DOIs I get:

$ doi2cff init https://doi.org/10.1186/1471-2105-13-187
Traceback (most recent call last):
  File "/usr/bin/doi2cff", line 11, in <module>
    load_entry_point('doi2cff==1.0.0', 'console_scripts', 'doi2cff')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/doi2cff/cli.py", line 54, in init
    raise NotImplemented('Unable to process doi, converter not implemented')
TypeError: 'NotImplementedType' object is not callable

Same happens for

doi2cff init https://doi.org/10.1093/bioinformatics/btp347
doi2cff init https://doi.org/10.1099/mgen.0.000131
doi2cff init https://doi.org/10.1093/bioinformatics/btr703

Any idea what might went wrong for these DOIs?

Kind regards, Andreas.

jspaaks commented 5 years ago

Hi Andreas, Thanks for your comment. I think I remember that doi2cff only covers zenodo dois ( or maybe even Zenodo software dois? Not sure). Also when looking at the specific error that indeed seems to be the cause.

When I do

doi2cff init https://doi.org/10.5281/zenodo.2609141

I get something that looks like valid CFF, based on the metadata from the corresponding Zenodo record.

Hope this helps, -Jurriaan

tillea commented 5 years ago

Hi Jurriaan, thanks for your quick reply.

On Tue, Jun 25, 2019 at 08:41:14AM +0000, Jurriaan H. Spaaks wrote:

I think I remember that doi2cff only covers zenodo dois ( or maybe even Zenodo software dois? Not sure). Also when looking at the specific error that indeed seems to be the cause.

I admit I had no idea that Zenodo dois exist and specifically what might be the difference to any other DOI.

I get something that looks like valid CFF, based on the metadata from the corresponding Zenodo record.

Does this mean other dois then Zenodo will not supported? It would help to stress this more explicitly and provide a better error message than a bug trace output from the script.

Thanks for this software anyway, Andreas.

jspaaks commented 5 years ago

So the difference between dois from various sources is that they potentially have metadata in a different format, which doi2cff then must translate to CFF. Since we (the Netherlands eScience Center) use Zenodo to assign dois to releases of software that we create, @sverhoeven thought it useful to have a tool that helps people with creation of a CFF file based on whatever metadata can already be harvested from (in our case) Zenodo; with the option to extend the software for other sources/other doi issuers, like for example FigShare.

Note that the doi2cff workflow assumes that the metadata from Zenodo is good. And that is also its main problem, because the metadata is usually not good unless authors really make an effort, either by manually editing the metadata for their records, or as I myself tend to do, by including a .zenodo.json file in my repos (basically a way to tell Zenodo what you want the metadata to be).

Because of this, I personally prefer to have the reverse flow direction of information, so I use the following workflow:

  1. create a CITATION.cff by hand using cffinit
  2. use cffconvert to convert the CFF information to a .zenodo.json file (other formats are available as well)
  3. git add CITATION.cff .zenodo.json, commit and push to the repo
  4. use the github-zenodo integration to archive copies of my software releases: this way, whenever I push make a new release on github, I'll get a persistent identifier (doi) from Zenodo.

With this workflow, I get good metadata on Zenodo, I get a DOI, and I get CFF which is consistent with whatever the metadata is on Zenodo.

As for your question, Does this mean other dois then Zenodo will not supported?: if I may speak for @sverhoeven: we are not against creating/incorporating converters that convert from e.g FigShare dois to CFF, it's just that it is not near the top of our todo list. We'd welcome Pull Requests that extend or improve doi2cff's functionality, but note that this is generally only useful when you have a whole bunch of records for which the metadata is good, and for which you want to create CFF files.

tillea commented 5 years ago

Hi again, thanks for the clarification. I assumed a general DOI parser which is probably a naive assumption. So please add a better error handling for those DOIs you can not parse. Kind regards, Andreas.

astrochun commented 2 years ago

It may be better to use the DataCite metadata as that would provide support for other data repositories (e.g. Figshare). But regarding journal article DOIs, this should be possible using the Crossref API.