Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/urschrei/pyzotero
/ functions
Functions
335 in github.com/urschrei/pyzotero
⨍
Functions
335
◇
Types & classes
62
↳
Endpoints
18
↓ 189 callers
Method
get
(self, key: str, default: str | None = None)
tests/mock_client.py:38
↓ 68 callers
Method
register
Register a mock route.
tests/mock_client.py:133
↓ 29 callers
Method
items
Get user items.
src/pyzotero/_client.py:479
↓ 24 callers
Method
_build_query
Set request parameters. Will always add the user ID if it hasn't been specifically set by an API method.
src/pyzotero/_client.py:423
↓ 19 callers
Function
build_url
Build a valid URL from base, path, and optional query parameters. This avoids string concatenation errors and leading/trailing slash issues.
src/pyzotero/_utils.py:27
↓ 19 callers
Method
last_request
Get the last recorded request.
tests/mock_client.py:164
↓ 17 callers
Method
get_doc
Return the requested test document
tests/test_zotero.py:36
↓ 13 callers
Method
_check_backoff
Wait if backoff is active.
src/pyzotero/_client.py:204
↓ 13 callers
Function
_zot_from_ctx
Build a local-mode Zotero client using the locale from the CLI context.
src/pyzotero/cli.py:68
↓ 13 callers
Method
json
Parse body as JSON.
tests/mock_client.py:66
↓ 11 callers
Function
_json
Serialise an object to a JSON string.
src/pyzotero/mcp_server.py:36
↓ 11 callers
Method
upload
File upload functionality. Goes through upload steps 0 - 3 (private class methods), and returns a dict noting success, failure, or un
src/pyzotero/_upload.py:217
↓ 9 callers
Method
add_parameters
Add URL parameters. Also ensure that only valid format/content combinations are requested.
src/pyzotero/_client.py:390
↓ 9 callers
Function
get_zotero_client
Get a Zotero client configured for local access.
src/pyzotero/_helpers.py:10
↓ 8 callers
Method
_post_check
Raise on HTTP error and record any server-supplied backoff. Centralises the post-request pattern used by every method that performs a
src/pyzotero/_client.py:210
↓ 8 callers
Method
item
Get a specific item.
src/pyzotero/_client.py:588
↓ 6 callers
Function
_error
Return a JSON-encoded error message.
src/pyzotero/mcp_server.py:41
↓ 6 callers
Method
create_items
Create new Zotero items. Accepts the following arguments: payload: a list containing one or more item dicts parentid:
src/pyzotero/_client.py:1043
↓ 6 callers
Method
tags
Get tags.
src/pyzotero/_client.py:702
↓ 6 callers
Method
top
Get user top-level items.
src/pyzotero/_client.py:560
↓ 5 callers
Method
children
Get a specific item's child items.
src/pyzotero/_client.py:619
↓ 5 callers
Function
format_s2_paper
Format a Semantic Scholar paper for output. Args: paper: Normalised paper dict from semantic_scholar module in_library: Boolean i
src/pyzotero/_helpers.py:82
↓ 5 callers
Function
token
Return a unique 32-char write-token.
src/pyzotero/_utils.py:59
↓ 4 callers
Method
_attachment
Create attachments. Accepts a list of one or more attachment template dicts and an optional parent Item ID. If this is specified,
src/pyzotero/_client.py:842
↓ 4 callers
Method
_cache
Add a retrieved template to the cache for 304 checking. Accepts a dict and key name, adds the retrieval time, and adds both to self.t
src/pyzotero/_client.py:236
↓ 4 callers
Method
_check_response
Raise on HTTP error and record any server-supplied backoff.
src/pyzotero/_upload.py:47
↓ 4 callers
Function
_normalise_paper
Normalise paper data from Semantic Scholar to a consistent format. Args: paper_data: Raw paper data from the API Returns: No
src/pyzotero/semantic_scholar.py:173
↓ 4 callers
Method
_retrieve_data
Retrieve Zotero items via the API. Combine endpoint and request to access the specific resource. Returns a JSON document.
src/pyzotero/_client.py:266
↓ 4 callers
Method
_set_backoff
Set backoff expiration time.
src/pyzotero/_client.py:200
↓ 4 callers
Method
_striplocal
Remove the leading '/api' substring from urls if running in local mode.
src/pyzotero/_client.py:190
↓ 4 callers
Function
annotate_with_library
Annotate papers with in_library status based on DOI matching. Args: papers: List of normalised paper dicts doi_map: Dict mapping
src/pyzotero/_helpers.py:114
↓ 4 callers
Function
build_doi_index
Build a mapping of normalised DOIs to Zotero item keys.
src/pyzotero/_helpers.py:58
↓ 4 callers
Method
collections
Get user collections.
src/pyzotero/_client.py:653
↓ 4 callers
Method
create_collections
Create new Zotero collections. Accepts one argument, a list of dicts containing the following keys: 'name': the name of the collectio
src/pyzotero/_client.py:1101
↓ 4 callers
Method
everything
Retrieve all items in the library for a particular query. This method will override the 'limit' parameter if it's been set.
src/pyzotero/_client.py:744
↓ 4 callers
Function
get_backoff_duration
Extract backoff duration from response headers. The Zotero API may return backoff instructions via either the 'Backoff' or 'Retry-After' head
src/pyzotero/_utils.py:70
↓ 3 callers
Function
_make_request
Make an HTTP GET request to the Semantic Scholar API. Args: url: The full URL to request params: Optional dict of query parameter
src/pyzotero/semantic_scholar.py:60
↓ 3 callers
Function
_run_s2_lookup
Drive the shared Semantic-Scholar-by-DOI lookup flow. Fetches papers via ``lookup(doi, id_type="doi", limit=limit)``, applies the ``min_citat
src/pyzotero/cli.py:73
↓ 3 callers
Function
_run_s2_tool_lookup
Drive the shared Semantic-Scholar-by-DOI lookup flow and return JSON. Fetches papers via ``lookup(doi, id_type="doi", limit=limit)``, applies
src/pyzotero/mcp_server.py:46
↓ 3 callers
Method
_totals
General method for returning total counts.
src/pyzotero/_client.py:463
↓ 3 callers
Function
build_doi_index_full
Build a mapping of normalised DOIs to Zotero item keys and original DOIs. Returns: Dict mapping normalised DOIs to dicts with 'key' and '
src/pyzotero/_helpers.py:38
↓ 3 callers
Method
check_items
Check that items to be created contain no invalid dict keys. Accepts a single argument: a list of one or more dicts. The retrieved fi
src/pyzotero/_client.py:939
↓ 3 callers
Function
chunks
Yield successive n-sized chunks from an iterable.
src/pyzotero/_utils.py:64
↓ 3 callers
Method
collection
Get user collection.
src/pyzotero/_client.py:645
↓ 3 callers
Method
collection_tags
Get a specific collection's tags.
src/pyzotero/_client.py:639
↓ 3 callers
Function
error_handler
Error handler for HTTP requests. Raises an appropriate PyZoteroError subclass for the response status code. HTTP 429 responses are a special
src/pyzotero/errors.py:127
↓ 3 callers
Method
follow
Return the result of the call to the URL in the 'Next' link.
src/pyzotero/_client.py:720
↓ 3 callers
Function
format_creators
Flatten Zotero creator dicts to display strings. Zotero creators may carry either (firstName, lastName) or a single ``name`` field; emit ``"<
src/pyzotero/_helpers.py:63
↓ 3 callers
Method
get_subset
Retrieve a subset of items. Accepts a single argument: a list of item IDs.
src/pyzotero/_client.py:761
↓ 3 callers
Method
item_template
Get a template for a new item.
src/pyzotero/_client.py:815
↓ 3 callers
Method
latest_requests
Get all recorded requests.
tests/mock_client.py:168
↓ 3 callers
Function
normalise_doi
Normalise a DOI for case-insensitive matching. Strips common prefixes (https://doi.org/, http://doi.org/, doi:) and converts to lowercase. DO
src/pyzotero/_helpers.py:15
↓ 3 callers
Method
update_item
Update an existing item. Accepts one argument, a dict containing Item data.
src/pyzotero/_client.py:1199
↓ 2 callers
Method
_attachment_template
Return a new attachment template of the required type. Types: imported_file, imported_url, linked_file, linked_url
src/pyzotero/_client.py:835
↓ 2 callers
Method
_batch_update
POST a payload to the library in chunks of DEFAULT_NUM_ITEMS. ``collection`` is the last path segment (e.g. ``"items"`` or ``"collect
src/pyzotero/_client.py:1219
↓ 2 callers
Method
_build_response
( status: int, headers: httpx.Headers, stream: ByteStream | None )
src/pyzotero/filetransport.py:90
↓ 2 callers
Function
_check_response
Check HTTP response and raise appropriate exceptions. Args: response: httpx Response object Raises: RateLimitError: If rate
src/pyzotero/semantic_scholar.py:85
↓ 2 callers
Method
_delete_entity
Dispatch a DELETE against one or many entities of the same type. ``collection`` is the path segment (e.g. ``"items"``); ``key_param``
src/pyzotero/_client.py:1324
↓ 2 callers
Function
_err_msg
Return a nicely-formatted error message for an HTTP response.
src/pyzotero/errors.py:117
↓ 2 callers
Function
_format_paper_id
Format a paper identifier for the Semantic Scholar API. Semantic Scholar accepts various identifier formats: - DOI: DOI:10.1234/example -
src/pyzotero/semantic_scholar.py:108
↓ 2 callers
Method
_handle
(self, request: Request)
src/pyzotero/filetransport.py:70
↓ 2 callers
Function
_paper_list_endpoint
Fetch a paper-list endpoint (``.../citations`` or ``.../references``). Both endpoints return ``{"data": [{<wrapper_key>: {...}}, ...], ...}``;
src/pyzotero/semantic_scholar.py:239
↓ 2 callers
Method
_resolve_path
(request: Request)
src/pyzotero/filetransport.py:82
↓ 2 callers
Method
_run_register_upload
Drive Zupload.upload through to the register step and return that request. _get_auth is mocked to return valid auth data and the storage (S3)
tests/test_zotero.py:1386
↓ 2 callers
Method
_tags_data
Format and return data from API calls which return Tags.
src/pyzotero/_client.py:809
↓ 2 callers
Method
_updated
Call to see if a template request returns 304. Accepts: - a string to combine with the API endpoint - a dict of format values
src/pyzotero/_client.py:350
↓ 2 callers
Method
attachment_both
Add child attachments using title, filename. Args: files: One or more lists or tuples containing (title, file path).
src/pyzotero/_client.py:1177
↓ 2 callers
Method
attachment_simple
Add attachments using filenames as title. Args: files: One or more file paths to add as attachments. parentid: Option
src/pyzotero/_client.py:1160
↓ 2 callers
Method
collection_items
Get a specific collection's items.
src/pyzotero/_client.py:627
↓ 2 callers
Method
collection_items_top
Get a specific collection's top-level items.
src/pyzotero/_client.py:633
↓ 2 callers
Function
copy_specific_pdf
Copy a specific PDF attachment from Zotero library to specified folder using dump() Args: item_id (str): Zotero item ID outp
example/local_copy_pdf.py:6
↓ 2 callers
Method
default_headers
Return headers that are always OK to include.
src/pyzotero/_client.py:226
↓ 2 callers
Method
delete_item
Delete Items from a Zotero library. Accepts a single argument: a dict containing item data OR a list of dicts contain
src/pyzotero/_client.py:1354
↓ 2 callers
Method
file
Get the file from a specific item.
src/pyzotero/_client.py:594
↓ 2 callers
Function
filter_by_citations
Filter a list of papers by minimum citation count. Args: papers: List of normalised paper dicts min_citations: Minimum citation c
src/pyzotero/semantic_scholar.py:440
↓ 2 callers
Method
fulltext_item
Get full-text content for an item.
src/pyzotero/_client.py:491
↓ 2 callers
Method
item_attachment_link_modes
Get all available link mode types. Note: No viable REST API route was found for this, so I tested and built a list from documentation
src/pyzotero/_client.py:1034
↓ 2 callers
Method
item_fields
Get all available item fields.
src/pyzotero/_client.py:1026
↓ 2 callers
Method
item_types
Get all available item types.
src/pyzotero/_client.py:996
↓ 2 callers
Method
makeiter
Return a generator of func's results.
src/pyzotero/_client.py:735
↓ 2 callers
Method
publications
Return the contents of My Publications.
src/pyzotero/_client.py:439
↓ 2 callers
Function
search_papers
Search for papers by keyword query. Args: query: Search query string limit: Maximum number of results (default 100, max 100)
src/pyzotero/semantic_scholar.py:373
↓ 2 callers
Method
update_collection
Update a Zotero collection property such as 'name'. Accepts one argument, a dict containing collection data retrieved using e.g. 'col
src/pyzotero/_client.py:1137
↓ 1 callers
Method
__init__
(self, msg="Rate limit exceeded. Please wait and try again.")
src/pyzotero/semantic_scholar.py:49
↓ 1 callers
Method
__init__
(self, **kwargs: Any)
src/pyzotero/filetransport.py:136
↓ 1 callers
Method
_check_for_component
Check a url path query fragment for a specific query parameter.
src/pyzotero/_client.py:186
↓ 1 callers
Method
_cleanup
Remove keys we added for internal use.
src/pyzotero/_client.py:248
↓ 1 callers
Method
_create_prelim
Step 0: Register intent to upload files.
src/pyzotero/_upload.py:73
↓ 1 callers
Method
_extract_links
Extract self, first, next, last links from a request response.
src/pyzotero/_client.py:326
↓ 1 callers
Function
_extract_zip_attachment
Extract the single file from a Zotero-compressed attachment response. The Zotero API zips plain-text attachments when the redirect carries the
src/pyzotero/_decorators.py:102
↓ 1 callers
Method
_get_auth
Step 1: get upload authorisation for a file.
src/pyzotero/_upload.py:113
↓ 1 callers
Function
_mock_zotero
Create a mock Zotero client.
tests/test_mcp.py:120
↓ 1 callers
Function
_parse_bibtex
Parse a BibTeX response body into a BibDatabase.
src/pyzotero/_decorators.py:118
↓ 1 callers
Method
_register_upload
Step 3: upload successful, so register it. For a new file we send ``If-None-Match: *``; when replacing an existing file's contents we
src/pyzotero/_upload.py:191
↓ 1 callers
Method
_upload_file
Step 2: auth successful, and file not on server. See zotero.org/support/dev/server_api/file_upload#a_full_upload reg_key and md5 are
src/pyzotero/_upload.py:151
↓ 1 callers
Method
_validate
Validate saved search conditions. Raises an error if any contain invalid operators.
src/pyzotero/_search.py:132
↓ 1 callers
Method
_verify
Ensure that all files to be attached exist. open()'s better than exists(), cos it avoids a race condition.
src/pyzotero/_upload.py:57
↓ 1 callers
Method
addto_collection
Add item to a collection. Accepts two arguments: The collection ID, and an item dict.
src/pyzotero/_client.py:1253
↓ 1 callers
Method
collection_versions
Return dict associating collection keys to versions. Accepts a since= parameter in kwargs to limit the data to those updated since.
src/pyzotero/_client.py:542
↓ 1 callers
Method
collections_sub
Get subcollections for a specific collection.
src/pyzotero/_client.py:690
next →
1–100 of 335, ranked by callers