Skip to main content

Interact with Zotero using papis

Project description

https://badge.fury.io/py/papis-zotero.svg https://github.com/papis/papis-zotero/workflows/CI/badge.svg

Zotero compatibility for papis

Installation

To install the latest release from PyPI

python -m pip install papis-zotero

To install the latest development version

python -m pip install papis-zotero@https://github.com/papis/papis-zotero.git#egg=papis-zotero

Development

This project uses setup.py and setuptools for its build system. To develop the code, it is recommended to start up a virtual environment and install the project in editable mode using, e.g.:

python -m pip install -e '.[develop]'

After installation always check that the command is correctly recognized, e.g. by looking at the help output

papis zotero --help

Importing from BibTeX

Zotero supports exporting different variants of BibTeX or BibLaTeX files (from Files > Export Library). The resulting bib file can be directly imported into papis using

papis bibtex read library.bib import --all

but a better choice is using this command, as it has better support for special Zotero fields. To import a given exported library run

papis zotero import --from-bibtex library.bib

BibTeX files exported by Zotero can also include has some PDF entries, e.g. they can look like

@article{Einstein1905Photon,
    author = { A. Einstein },
    doi = { 10.1002/andp.19053220607 },
    journal = { Ann. Phys. },
    pages = { 132--148 },
    title = { Über einen die Erzeugung und Verwandlung des Lichtes
        betreffenden heuristischen Gesichtspunkt },
    file = { Full Text:path/to/some/relative/file.pdf },
    volume = { 322 },
    year = { 1905 },
}

From this, papis-zotero will interpret the path of the file entry as a relative path to library.bib passed to the import command using --from-bibtex. The files are skipped if they do not exist at the expected location.

By default, papis-zotero will add the documents to your current library. When initially importing a big library, it is recommended to always import it into a scratch folder, so that you can check the import. This can be easily done using

papis zotero import --from-bibtex library.bib --outfolder some/folder/lib

When you are ready you can move this folder to a final papis library.

Importing from Zotero SQLite

Zotero also maintains a database of all its files and collections under a zotero.sqlite file. You can check where this file is located by going to Edit > Preferences > Advanced > Data Directory Location (may vary depending on the Zotero version). The Zotero data directory should contain the zotero.sqlite file and a storage directory with the files for each document.

The SQLite database maintained by Zotero can be imported directly (without using a BibTeX export) by papis-zotero. This can be done by passing

papis zotero import --from-sql-folder <ZOTERO_DATA_DIRECTORY>

where ZOTERO_DATA_DIRECTORY is the folder containing the zotero.sqlite file. By default, papis-zotero will add the imported documents to your current library directory, but it can be customized using the --outfolder argument.

Using Zotero connectors

This plugin can also connect to a Zotero connector browser plugin. First, one such plugin should be installed from the Zotero website. Then, make sure that Zotero itself is not running (and connected to the connector) and run

papis zotero serve

to start listening to your browser for incoming data. Whenever you click the Zotero button to add a paper, papis-zotero will add this paper to its library instead.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

papis-zotero-0.1.2.tar.gz (16.2 kB view details)

Uploaded Source

File details

Details for the file papis-zotero-0.1.2.tar.gz.

File metadata

  • Download URL: papis-zotero-0.1.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for papis-zotero-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a3747b15e9b64550252fbf3d4e48365f19a61badfe8020368a8f47aaf6f69086
MD5 0cf7e125a9e610dbf5ba1909745bfb51
BLAKE2b-256 4bbe287d2fd72c54ad9d764fcb60d2a2812af820dbeeb3586842eee27241c821

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page