Interact with Zotero using papis
Project description
Zotero compatibility for Papis
Installation
Pip
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
Nix
For Nix and NixOS users, a Nix flake is included in this repository and can be used to install the package. There are many ways of doing so, for instance like so:
{
pkgs,
inputs,
...
}: {
home.packages = with pkgs; [
(
python3.withPackages
(
ps: [
inputs.papis.packages.${system}.default
inputs.papis-zotero.packages.${system}.default
# you can add other packages you might want to make available for papis
# ps.jinja2
]
)
)
# Here you can list other packages, such as
# typst
# hayagriva
# zotero_7
];
}
Arch
Arch users can use the AUR to install the package.
Importing from Zotero SQLite (preferred)
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 with:
papis zotero import --from-sql-folder <ZOTERO_DATA_DIRECTORY>
Here, 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.
Importing from BibTeX (alternative)
Zotero can export different variants of BibTeX or BibLaTeX files (from Files > Export Library). You could import the resulting .bib file directly with Papis (with the papis bibtex command), but papis-zotero provides a specialised command. This command 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 include attached files as shown in the below example:
@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 },
}
Given this, papis-zotero will interpret the path of the file entry as a relative path to the 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 verify 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.
Using Zotero connectors
This plugin can also connect to a Zotero connector browser plugin. First, such a 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
Papis now starts listening to your browser for incoming data. Whenever you click the Zotero button to add a paper, papis-zotero will add this paper to the Papis library instead.
Development
This project uses pyproject.toml and hatchling 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
If you use the Nix flake, you can also use the included devShell with nix develop.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file papis_zotero-0.3.0.tar.gz.
File metadata
- Download URL: papis_zotero-0.3.0.tar.gz
- Upload date:
- Size: 678.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66b4d89c786ea2609769dd53b1321dfefaf8cc6cc9ea5c90b878801cbb345886
|
|
| MD5 |
aec85b30d123f70a9a584a0fad9c271f
|
|
| BLAKE2b-256 |
8f328dd30c71bff58254ceb0fa7c3b42ba634dba66fd28ded8ef55b8e3c747ab
|
Provenance
The following attestation bundles were made for papis_zotero-0.3.0.tar.gz:
Publisher:
main.yml on papis/papis-zotero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
papis_zotero-0.3.0.tar.gz -
Subject digest:
66b4d89c786ea2609769dd53b1321dfefaf8cc6cc9ea5c90b878801cbb345886 - Sigstore transparency entry: 928511818
- Sigstore integration time:
-
Permalink:
papis/papis-zotero@af78897a704a6a121ee86039dacb3bde5ea2cf15 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/papis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@af78897a704a6a121ee86039dacb3bde5ea2cf15 -
Trigger Event:
push
-
Statement type:
File details
Details for the file papis_zotero-0.3.0-py3-none-any.whl.
File metadata
- Download URL: papis_zotero-0.3.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4110fd3b0cda9f547ea20ed1571a0b4ec7b73e9199579267b0cec84efd89ea15
|
|
| MD5 |
7ae8e74d8bccf6c9388815522cfe7628
|
|
| BLAKE2b-256 |
bb02946cb66e8b3371871afbf60cb7bceaec283675fa52d0c259a8b16742dd41
|
Provenance
The following attestation bundles were made for papis_zotero-0.3.0-py3-none-any.whl:
Publisher:
main.yml on papis/papis-zotero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
papis_zotero-0.3.0-py3-none-any.whl -
Subject digest:
4110fd3b0cda9f547ea20ed1571a0b4ec7b73e9199579267b0cec84efd89ea15 - Sigstore transparency entry: 928511832
- Sigstore integration time:
-
Permalink:
papis/papis-zotero@af78897a704a6a121ee86039dacb3bde5ea2cf15 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/papis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@af78897a704a6a121ee86039dacb3bde5ea2cf15 -
Trigger Event:
push
-
Statement type: