MicheleCotrufo / pdf2bib

A python library/command-line tool to quickly and automatically generate BibTeX data starting from the pdf file of a scientific publication.
58 stars 7 forks source link

Only the first file is handled #12

Closed user202729 closed 4 months ago

user202729 commented 4 months ago

Even though it's advertised that multiple paths can be passed.

Caused by the following piece of code:

    ## The following block of code (until ##END) is required to make sure that 'path' is a required parameter, except for the case when
    ## -install--right--click or -uninstall--right--click are used
    if isinstance(args.path,list):
        if len(args.path)>0:
            target = args.path[0]
        else:
            target = ""
    else:
        target = args.path
MicheleCotrufo commented 4 months ago

Not sure what you mean that "it's advertised that multiple paths can be passed". The path can be either a folder (potentially containing multiple pdf files) or a single pdf file

positional arguments: path Relative path of the target pdf file or of the targe folder.

user202729 commented 4 months ago

I mean if you type pdf2bib --help, the error message is

usage: pdf2bib [-h] [-v] [-s FILENAME_BIBTEX] [-clip] [-install--right--click]
               [-uninstall--right--click]
               [path ...]

Generate BibTeX entries of scientific publications starting from the pdf files. It requires an
internet connection.

positional arguments:
  path                  Relative path of the target pdf file or of the targe folder.

[path ...] implies that multiple paths can be passed, no?

MicheleCotrufo commented 4 months ago

Ok, I see the potential confusion, thanks. Yes, as you pointed out, in principle the code could be tweaked to be able to handle multiple paths, but it would need several tests. I might try to work on it in the future, but feel free to do a PR if you already have a tested code! :)