Python 3 wrapper for the Zotero API
Project description
Pyzotero3: An API Client for the Zotero API (python 3 only)
Quickstart
pip install pyzotero3
- You'll need the ID of the personal or group library you want to access:
- Your personal library ID is available here, in the section
Your userID for use in API calls
- For group libraries, the ID can be found by opening the group's page:
https://www.zotero.org/groups/groupname
, and hovering over thegroup settings
link. The ID is the integer after/groups/
- Your personal library ID is available here, in the section
- You'll also need† to get an API key here
- Are you accessing your own Zotero library?
library_type
is'user'
- Are you accessing a shared group library?
library_type
is'group'
.
Then:
from pyzotero import zotero
zot = zotero.Zotero(library_id, library_type, api_key)
items = zot.top(limit=5)
# we've retrieved the latest five top-level items in our library
# we can print each item's item type and ID
for item in items:
print('Item: %s | Key: %s' % (item['data']['itemType'], item['data']['key']))
Documentation
Full documentation of available Pyzotero methods, code examples, and sample output is available on Read The Docs.
Installation
- Using pip:
pip install pyzotero3
(it's available as a wheel, and is tested on Python 3.6, 3.7, 3.8, 3.9 and 3.10) - From a local clone, if you wish to install Pyzotero from a specific branch:
Example:
git clone git://github.com/rsalmaso/pyzotero3.git
cd pyzotero3
git checkout dev
pip install .
Testing
Run test_zotero.py
in the pyzotero/test directory, or, using Nose2, nose2
from the top-level directory.
Issues
The latest commits can be found on the main branch, although new features are currently rare. If you encounter an error, please open an issue.
Pull Requests
Pull requests are welcomed. Please read the contribution guidelines. In particular, please base your PR on the dev
branch.
Versioning
As of v1.0.0, Pyzotero is versioned according to Semver; version increments are performed as follows:
- MAJOR version will increment with incompatible API changes,
- MINOR version will increment when functionality is added in a backwards-compatible manner, and
- PATCH version will increment with backwards-compatible bug fixes.
Citation
Pyzotero has a DOI:
You may also cite Pyzotero using CITATION.cff.
A sample citation (APA 6th edition) might look like:
Stephan Hügel, The Pyzotero Authors (2019, May 18). urschrei/pyzotero: Version v1.3.15. http://doi.org/10.5281/zenodo.2917290
License
Pyzotero is licensed under the MIT license. See license.txt for details.
† This isn't strictly true: you only need an API key for personal libraries and non-public group libraries.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for pyzotero3-1.4.25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52bd35f6a6e5595b9578d5cc9526e105d3a3370c59a344dca92743e40ba4360e |
|
MD5 | adf409e595943f5b6515434dd849d205 |
|
BLAKE2b-256 | 97d08edefb831db435276e14149e3baf6ec8a6ae75e9030a5cf1cf6097b4ec42 |