Skip to main content

Python wrapper for the Zotero API

Project description

Supported Python versions Docs PyPI Version Anaconda-Server Badge Downloads

Pyzotero: An API Client for the Zotero API

Quickstart

  1. pip install pyzotero or conda config --add channels conda-forge && conda install pyzotero
  2. 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 the group settings link. The ID is the integer after /groups/
  3. You'll also need to get an API key here
  4. Are you accessing your own Zotero library? library_type is 'user'
  5. 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) # local=True for read access to local Zotero
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 pyzotero (it's available as a wheel, and is tested on Python 3.7 and up)
  • Using Anaconda:conda config --add channels conda-forge && conda install pyzotero
  • 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 main
pip install .

Testing

Run pytest . 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:

  1. MAJOR version will increment with incompatible API changes,
  2. MINOR version will increment when functionality is added in a backwards-compatible manner, and
  3. PATCH version will increment with backwards-compatible bug fixes.

Citation

Pyzotero has a DOI:
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 Blue Oak Model Licence 1.0.0. See LICENSE.md 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 Distribution

pyzotero-1.6.11.tar.gz (552.3 kB view details)

Uploaded Source

Built Distribution

pyzotero-1.6.11-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file pyzotero-1.6.11.tar.gz.

File metadata

  • Download URL: pyzotero-1.6.11.tar.gz
  • Upload date:
  • Size: 552.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyzotero-1.6.11.tar.gz
Algorithm Hash digest
SHA256 9773fa938f88ad3157d8125b9418e9bd8f2723395d0d1f034f741a43e0735774
MD5 189531b1dc3ac20c58af6e1ed06ea344
BLAKE2b-256 4f2033cfc165d48410a3d6c8fe7fb715ac51d4c646b41ee743a24f931c1ad96a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyzotero-1.6.11.tar.gz:

Publisher: tests.yml on urschrei/pyzotero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyzotero-1.6.11-py3-none-any.whl.

File metadata

  • Download URL: pyzotero-1.6.11-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyzotero-1.6.11-py3-none-any.whl
Algorithm Hash digest
SHA256 949cdff92fd688fe70f609c928f09ab25a7d2aa05f35c575725d5bd0f395d3b4
MD5 07630c5213c718da2c9bf64b0e7a6e1b
BLAKE2b-256 b5750bced57e6ba014adeeaa504205c4a92d5211b6c5daa20c0a80b06de6d0f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyzotero-1.6.11-py3-none-any.whl:

Publisher: tests.yml on urschrei/pyzotero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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