pip install pyzotero
- 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
isuser
- Are you accessing a shared group library?
library_type
isgroup
.
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'])
Full documentation of available Pyzotero methods, code examples, and sample output is available on Read The Docs.
- Using pip:
pip install pyzotero
(it's available as a wheel, and is tested on Python 2.7, 3.4, and 3.5) - From a local clone, if you wish to install Pyzotero from a specific branch:
Example:
git clone git://github.com/urschrei/pyzotero.git
cd pyzotero
git checkout dev
pip install .
Run test_zotero.py
in the pyzotero/test directory, or, using Nose, nosetests
from the top-level directory.
Pyzotero remains in development as of September 2015. The latest commits can be found on the dev branch. If you encounter an error, please open an issue.
Pull requests are welcomed. Please read the contribution guidelines.
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.
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.