MCPcopy Create free account

hub / github.com/urschrei/pyzotero / functions

Functions335 in github.com/urschrei/pyzotero

↓ 189 callersMethodget
(self, key: str, default: str | None = None)
tests/mock_client.py:38
↓ 68 callersMethodregister
Register a mock route.
tests/mock_client.py:133
↓ 29 callersMethoditems
Get user items.
src/pyzotero/_client.py:479
↓ 24 callersMethod_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 callersFunctionbuild_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 callersMethodlast_request
Get the last recorded request.
tests/mock_client.py:164
↓ 17 callersMethodget_doc
Return the requested test document
tests/test_zotero.py:36
↓ 13 callersMethod_check_backoff
Wait if backoff is active.
src/pyzotero/_client.py:204
↓ 13 callersFunction_zot_from_ctx
Build a local-mode Zotero client using the locale from the CLI context.
src/pyzotero/cli.py:68
↓ 13 callersMethodjson
Parse body as JSON.
tests/mock_client.py:66
↓ 11 callersFunction_json
Serialise an object to a JSON string.
src/pyzotero/mcp_server.py:36
↓ 11 callersMethodupload
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 callersMethodadd_parameters
Add URL parameters. Also ensure that only valid format/content combinations are requested.
src/pyzotero/_client.py:390
↓ 9 callersFunctionget_zotero_client
Get a Zotero client configured for local access.
src/pyzotero/_helpers.py:10
↓ 8 callersMethod_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 callersMethoditem
Get a specific item.
src/pyzotero/_client.py:588
↓ 6 callersFunction_error
Return a JSON-encoded error message.
src/pyzotero/mcp_server.py:41
↓ 6 callersMethodcreate_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 callersMethodtags
Get tags.
src/pyzotero/_client.py:702
↓ 6 callersMethodtop
Get user top-level items.
src/pyzotero/_client.py:560
↓ 5 callersMethodchildren
Get a specific item's child items.
src/pyzotero/_client.py:619
↓ 5 callersFunctionformat_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 callersFunctiontoken
Return a unique 32-char write-token.
src/pyzotero/_utils.py:59
↓ 4 callersMethod_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 callersMethod_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 callersMethod_check_response
Raise on HTTP error and record any server-supplied backoff.
src/pyzotero/_upload.py:47
↓ 4 callersFunction_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 callersMethod_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 callersMethod_set_backoff
Set backoff expiration time.
src/pyzotero/_client.py:200
↓ 4 callersMethod_striplocal
Remove the leading '/api' substring from urls if running in local mode.
src/pyzotero/_client.py:190
↓ 4 callersFunctionannotate_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 callersFunctionbuild_doi_index
Build a mapping of normalised DOIs to Zotero item keys.
src/pyzotero/_helpers.py:58
↓ 4 callersMethodcollections
Get user collections.
src/pyzotero/_client.py:653
↓ 4 callersMethodcreate_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 callersMethodeverything
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 callersFunctionget_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 callersFunction_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 callersFunction_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 callersFunction_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 callersMethod_totals
General method for returning total counts.
src/pyzotero/_client.py:463
↓ 3 callersFunctionbuild_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 callersMethodcheck_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 callersFunctionchunks
Yield successive n-sized chunks from an iterable.
src/pyzotero/_utils.py:64
↓ 3 callersMethodcollection
Get user collection.
src/pyzotero/_client.py:645
↓ 3 callersMethodcollection_tags
Get a specific collection's tags.
src/pyzotero/_client.py:639
↓ 3 callersFunctionerror_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 callersMethodfollow
Return the result of the call to the URL in the 'Next' link.
src/pyzotero/_client.py:720
↓ 3 callersFunctionformat_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 callersMethodget_subset
Retrieve a subset of items. Accepts a single argument: a list of item IDs.
src/pyzotero/_client.py:761
↓ 3 callersMethoditem_template
Get a template for a new item.
src/pyzotero/_client.py:815
↓ 3 callersMethodlatest_requests
Get all recorded requests.
tests/mock_client.py:168
↓ 3 callersFunctionnormalise_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 callersMethodupdate_item
Update an existing item. Accepts one argument, a dict containing Item data.
src/pyzotero/_client.py:1199
↓ 2 callersMethod_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 callersMethod_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 callersMethod_build_response
( status: int, headers: httpx.Headers, stream: ByteStream | None )
src/pyzotero/filetransport.py:90
↓ 2 callersFunction_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 callersMethod_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 callersFunction_err_msg
Return a nicely-formatted error message for an HTTP response.
src/pyzotero/errors.py:117
↓ 2 callersFunction_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 callersMethod_handle
(self, request: Request)
src/pyzotero/filetransport.py:70
↓ 2 callersFunction_paper_list_endpoint
Fetch a paper-list endpoint (``.../citations`` or ``.../references``). Both endpoints return ``{"data": [{<wrapper_key>: {...}}, ...], ...}``;
src/pyzotero/semantic_scholar.py:239
↓ 2 callersMethod_resolve_path
(request: Request)
src/pyzotero/filetransport.py:82
↓ 2 callersMethod_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 callersMethod_tags_data
Format and return data from API calls which return Tags.
src/pyzotero/_client.py:809
↓ 2 callersMethod_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 callersMethodattachment_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 callersMethodattachment_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 callersMethodcollection_items
Get a specific collection's items.
src/pyzotero/_client.py:627
↓ 2 callersMethodcollection_items_top
Get a specific collection's top-level items.
src/pyzotero/_client.py:633
↓ 2 callersFunctioncopy_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 callersMethoddefault_headers
Return headers that are always OK to include.
src/pyzotero/_client.py:226
↓ 2 callersMethoddelete_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 callersMethodfile
Get the file from a specific item.
src/pyzotero/_client.py:594
↓ 2 callersFunctionfilter_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 callersMethodfulltext_item
Get full-text content for an item.
src/pyzotero/_client.py:491
↓ 2 callersMethoditem_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 callersMethoditem_fields
Get all available item fields.
src/pyzotero/_client.py:1026
↓ 2 callersMethoditem_types
Get all available item types.
src/pyzotero/_client.py:996
↓ 2 callersMethodmakeiter
Return a generator of func's results.
src/pyzotero/_client.py:735
↓ 2 callersMethodpublications
Return the contents of My Publications.
src/pyzotero/_client.py:439
↓ 2 callersFunctionsearch_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 callersMethodupdate_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 callersMethod__init__
(self, msg="Rate limit exceeded. Please wait and try again.")
src/pyzotero/semantic_scholar.py:49
↓ 1 callersMethod__init__
(self, **kwargs: Any)
src/pyzotero/filetransport.py:136
↓ 1 callersMethod_check_for_component
Check a url path query fragment for a specific query parameter.
src/pyzotero/_client.py:186
↓ 1 callersMethod_cleanup
Remove keys we added for internal use.
src/pyzotero/_client.py:248
↓ 1 callersMethod_create_prelim
Step 0: Register intent to upload files.
src/pyzotero/_upload.py:73
↓ 1 callersMethod_extract_links
Extract self, first, next, last links from a request response.
src/pyzotero/_client.py:326
↓ 1 callersFunction_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 callersMethod_get_auth
Step 1: get upload authorisation for a file.
src/pyzotero/_upload.py:113
↓ 1 callersFunction_mock_zotero
Create a mock Zotero client.
tests/test_mcp.py:120
↓ 1 callersFunction_parse_bibtex
Parse a BibTeX response body into a BibDatabase.
src/pyzotero/_decorators.py:118
↓ 1 callersMethod_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 callersMethod_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 callersMethod_validate
Validate saved search conditions. Raises an error if any contain invalid operators.
src/pyzotero/_search.py:132
↓ 1 callersMethod_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 callersMethodaddto_collection
Add item to a collection. Accepts two arguments: The collection ID, and an item dict.
src/pyzotero/_client.py:1253
↓ 1 callersMethodcollection_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 callersMethodcollections_sub
Get subcollections for a specific collection.
src/pyzotero/_client.py:690
next →1–100 of 335, ranked by callers