Add

The add command is one of the central commands of the papis command line interface. It is a very versatile command with a fair amount of options.

There are also customization settings available for this command, check out the configuration page for add.

Examples

  • Add a document located in ~/Documents/interesting.pdf and name the folder where it will be stored in the database interesting-paper-2021

    papis add ~/Documents/interesting.pdf \
        --folder-name interesting-paper-2021
    

    if you want to add directly some key values, like author, title and tags, you can also run the following:

    papis add ~/Documents/interesting.pdf \
        --folder-name interesting-paper-2021 \
        --set author 'John Smith' \
        --set title 'The interesting life of bees' \
        --set year 1985 \
        --set tags 'biology interesting bees'
    
  • Add a paper that you have locally in a file and get the paper information through its doi identifier (in this case 10.10763/1.3237134 as an example):

    papis add ~/Documents/interesting.pdf --from doi 10.10763/1.3237134
    
  • Add paper to a library named machine-learning from arxiv.org

    papis -l machine-learning add \
        --from arxiv https://arxiv.org/abs/1712.03134
    
  • If you do not want copy the original pdfs into the library, you can also tell papis to just create a link to them, for example

    papis add --link ~/Documents/interesting.pdf \
        --from doi 10.10763/1.3237134
    

    will add an entry into the papis library, but the pdf document will remain at ~/Documents/interesting.pdf, and in the document’s folder there will be a link to ~/Documents/interesting.pdf instead of the file itself. Of course you always have to be sure that the document at ~/Documents/interesting.pdf does not disappear, otherwise you will end up without a document to open.

  • Papis also tries to make sense of the inputs that you have passed to the command, for instance you could provide only a doi and papis will try to know if this is indeed a doi

    papis add 10.1103/PhysRevLett.123.156401
    

    or from a url

    papis add journals.aps.org/prl/abstract/10.1103/PhysRevLett.123.156401
    papis add https://arxiv.org/abs/1712.03134
    

Examples in python

There is a python function in the add module that can be used to interact in a more effective way in python scripts,

papis.commands.add.run(paths: List[str], data: Dict[str, Any] = {}, folder_name: Optional[str] = None, file_name: Optional[str] = None, subfolder: Optional[str] = None, confirm: bool = False, open_file: bool = False, edit: bool = False, git: bool = False, link: bool = False)None[source]
Parameters
  • paths ([]) – Paths to the documents to be added

  • data (dict) – Data for the document to be added. If more data is to be retrieved from other sources, the data dictionary will be updated from these sources.

  • folder_name (str) – Name of the folder where the document will be stored

  • file_name (str) – File name of the document’s files to be stored.

  • subfolder (str) – Folder within the library where the document’s folder should be stored.

  • confirm (bool) – Whether or not to ask user for confirmation before adding.

  • open_file (bool) – Whether or not to ask the user for opening the file before adding.

  • edit (bool) – Whether or not to ask user for editing the info file before adding.

  • git (bool) – Whether or not to ask user for committing before adding, in the case of course that the library is a git repository.

Cli

papis add

Add a document into a given library

papis add [OPTIONS] [FILES]...

Options

-h, --help

Show this message and exit.

-s, --set <set_list>

Set some information before

-d, --subfolder <subfolder>

Subfolder in the library

--folder-name <folder_name>

Name for the document’s folder (papis format)

--file-name <file_name>

File name for the document (papis format)

--from <from_importer>

Add document from a specific importer (arxiv, crossref, doi, pmid, bibtex, pdf2doi, isbn, pdf2arxivid, folder, lib, yaml)

-b, --batch

Batch mode, do not prompt or otherwise

--confirm, --no-confirm

Ask to confirm before adding to the collection

--open, --no-open

Open file before adding document

--edit, --no-edit

Edit info file before adding document

Instead of copying the file to the library, create a link toits original location

--git, --no-git

Git add and commit the new document

--list-importers, --li

List all available papis importers

Arguments

FILES

Optional argument(s)