pyzotero 1.7.6__tar.gz → 1.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyzotero-1.7.6 → pyzotero-1.8.0}/PKG-INFO +3 -3
- {pyzotero-1.7.6 → pyzotero-1.8.0}/README.md +2 -2
- {pyzotero-1.7.6 → pyzotero-1.8.0}/doc/conf.py +1 -2
- {pyzotero-1.7.6 → pyzotero-1.8.0}/doc/index.rst +8 -8
- {pyzotero-1.7.6 → pyzotero-1.8.0}/pyproject.toml +8 -3
- pyzotero-1.8.0/src/pyzotero/__init__.py +67 -0
- pyzotero-1.7.6/src/pyzotero/zotero.py → pyzotero-1.8.0/src/pyzotero/_client.py +253 -893
- pyzotero-1.8.0/src/pyzotero/_decorators.py +195 -0
- pyzotero-1.8.0/src/pyzotero/_search.py +190 -0
- pyzotero-1.8.0/src/pyzotero/_upload.py +241 -0
- pyzotero-1.8.0/src/pyzotero/_utils.py +86 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/src/pyzotero/cli.py +420 -1
- pyzotero-1.8.0/src/pyzotero/errors.py +185 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/src/pyzotero/filetransport.py +2 -2
- pyzotero-1.8.0/src/pyzotero/semantic_scholar.py +441 -0
- pyzotero-1.8.0/src/pyzotero/zotero.py +69 -0
- pyzotero-1.8.0/src/pyzotero/zotero_errors.py +58 -0
- pyzotero-1.8.0/tests/mock_client.py +185 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/test_async.py +0 -1
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/test_zotero.py +321 -306
- pyzotero-1.7.6/src/pyzotero/__init__.py +0 -7
- pyzotero-1.7.6/src/pyzotero/zotero_errors.py +0 -141
- {pyzotero-1.7.6 → pyzotero-1.8.0}/LICENSE.md +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/doc/Makefile +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/doc/_templates/layout.html +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/doc/cat.png +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/__init__.py +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/attachments_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/citation_doc.xml +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/collection_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/collection_tags.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/collection_versions.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/collections_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/creation_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/groups_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_fields.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_file.pdf +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_template.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_types.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/item_versions.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/items_doc.json +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/keys_doc.txt +0 -0
- {pyzotero-1.7.6 → pyzotero-1.8.0}/tests/api_responses/tags_doc.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: Python wrapper for the Zotero API
|
|
5
5
|
Keywords: Zotero,DH
|
|
6
6
|
Author: Stephan Hügel
|
|
@@ -82,8 +82,8 @@ Description-Content-Type: text/markdown
|
|
|
82
82
|
Then:
|
|
83
83
|
|
|
84
84
|
``` python
|
|
85
|
-
from pyzotero import
|
|
86
|
-
zot =
|
|
85
|
+
from pyzotero import Zotero
|
|
86
|
+
zot = Zotero(library_id, library_type, api_key) # local=True for read access to local Zotero
|
|
87
87
|
items = zot.top(limit=5)
|
|
88
88
|
# we've retrieved the latest five top-level items in our library
|
|
89
89
|
# we can print each item's item type and ID
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
Then:
|
|
16
16
|
|
|
17
17
|
``` python
|
|
18
|
-
from pyzotero import
|
|
19
|
-
zot =
|
|
18
|
+
from pyzotero import Zotero
|
|
19
|
+
zot = Zotero(library_id, library_type, api_key) # local=True for read access to local Zotero
|
|
20
20
|
items = zot.top(limit=5)
|
|
21
21
|
# we've retrieved the latest five top-level items in our library
|
|
22
22
|
# we can print each item's item type and ID
|
|
@@ -16,7 +16,6 @@ import sys
|
|
|
16
16
|
|
|
17
17
|
sys.path.insert(1, "..")
|
|
18
18
|
import pyzotero
|
|
19
|
-
from pyzotero import zotero as zot
|
|
20
19
|
|
|
21
20
|
# Tell Jinja2 templates the build is running on Read the Docs
|
|
22
21
|
if os.environ.get("READTHEDOCS", "") == "True":
|
|
@@ -24,7 +23,7 @@ if os.environ.get("READTHEDOCS", "") == "True":
|
|
|
24
23
|
html_context = {}
|
|
25
24
|
html_context["READTHEDOCS"] = True
|
|
26
25
|
|
|
27
|
-
author =
|
|
26
|
+
author = "Stephan Hügel"
|
|
28
27
|
current_year = datetime.datetime.now(tz=datetime.timezone.utc).date().year
|
|
29
28
|
|
|
30
29
|
html_context = {
|
|
@@ -30,8 +30,8 @@ Getting started (short version)
|
|
|
30
30
|
.. code-block:: python
|
|
31
31
|
:emphasize-lines: 1,2,3
|
|
32
32
|
|
|
33
|
-
from pyzotero import
|
|
34
|
-
zot =
|
|
33
|
+
from pyzotero import Zotero
|
|
34
|
+
zot = Zotero(library_id, library_type, api_key)
|
|
35
35
|
items = zot.top(limit=5)
|
|
36
36
|
# we've retrieved the latest five top-level items in our library
|
|
37
37
|
# we can print each item's item type and ID
|
|
@@ -205,8 +205,8 @@ Example:
|
|
|
205
205
|
.. code-block:: python
|
|
206
206
|
:emphasize-lines: 4
|
|
207
207
|
|
|
208
|
-
from pyzotero import
|
|
209
|
-
zot =
|
|
208
|
+
from pyzotero import Zotero
|
|
209
|
+
zot = Zotero('123', 'user', 'ABC1234XYZ')
|
|
210
210
|
# we now have a Zotero object, zot, and access to all its methods
|
|
211
211
|
first_ten = zot.items(limit=10)
|
|
212
212
|
# a list containing dicts of the ten most recently modified library items
|
|
@@ -731,8 +731,8 @@ Example:
|
|
|
731
731
|
|
|
732
732
|
.. code-block:: python
|
|
733
733
|
|
|
734
|
-
from pyzotero import
|
|
735
|
-
zot =
|
|
734
|
+
from pyzotero import Zotero
|
|
735
|
+
zot = Zotero(library_id, library_type, api_key)
|
|
736
736
|
# only retrieve a single item
|
|
737
737
|
# this will retrieve the most recently added/modified top-level item
|
|
738
738
|
first_item = zot.top(limit=1)
|
|
@@ -747,8 +747,8 @@ Example:
|
|
|
747
747
|
|
|
748
748
|
.. code-block:: python
|
|
749
749
|
|
|
750
|
-
from pyzotero import
|
|
751
|
-
zot =
|
|
750
|
+
from pyzotero import Zotero
|
|
751
|
+
zot = Zotero(library_id, library_type, api_key)
|
|
752
752
|
# retrieve all top-level items
|
|
753
753
|
toplevel = zot.everything(zot.top())
|
|
754
754
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyzotero"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.8.0"
|
|
4
4
|
description = "Python wrapper for the Zotero API"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.9"
|
|
@@ -43,12 +43,11 @@ pyzotero = "pyzotero.cli:main"
|
|
|
43
43
|
dev = [
|
|
44
44
|
"pytest >= 8.4.2",
|
|
45
45
|
"pytz>=2025.2",
|
|
46
|
-
"httpretty >= 1.1.4",
|
|
47
46
|
"python-dateutil",
|
|
48
47
|
"ipython",
|
|
49
48
|
"pytest-asyncio",
|
|
50
49
|
"pytest-cov>=6.0.0",
|
|
51
|
-
"tzdata>=2025.2"
|
|
50
|
+
"tzdata>=2025.2",
|
|
52
51
|
]
|
|
53
52
|
doc = [
|
|
54
53
|
"sphinx",
|
|
@@ -110,9 +109,15 @@ ignore = ["ANN001", "ANN003", "ANN202", "ANN201", "DOC201", "E501", "PLR0904", "
|
|
|
110
109
|
fixable = ["ALL"]
|
|
111
110
|
unfixable = []
|
|
112
111
|
|
|
112
|
+
[tool.ruff.lint.per-file-ignores]
|
|
113
|
+
"tests/*" = ["S101"] # Allow assert in tests
|
|
114
|
+
|
|
113
115
|
[tool.ruff.format]
|
|
114
116
|
# Like Black, use double quotes for strings.
|
|
115
117
|
quote-style = "double"
|
|
116
118
|
|
|
117
119
|
# Like Black, indent with spaces, rather than tabs.
|
|
118
120
|
indent-style = "space"
|
|
121
|
+
|
|
122
|
+
[tool.ty.rules]
|
|
123
|
+
possibly-missing-attribute = "ignore"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Pyzotero - Python wrapper for the Zotero API."""
|
|
2
|
+
|
|
3
|
+
import importlib.metadata
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
# __package__ allows for the case where __name__ is "__main__"
|
|
7
|
+
__version__ = importlib.metadata.version(__package__ or __name__)
|
|
8
|
+
except importlib.metadata.PackageNotFoundError:
|
|
9
|
+
__version__ = "0.0.0"
|
|
10
|
+
|
|
11
|
+
# Public API exports
|
|
12
|
+
from pyzotero._client import Zotero
|
|
13
|
+
from pyzotero._search import SavedSearch
|
|
14
|
+
from pyzotero._upload import Zupload
|
|
15
|
+
from pyzotero._utils import chunks
|
|
16
|
+
from pyzotero.errors import (
|
|
17
|
+
CallDoesNotExistError,
|
|
18
|
+
ConflictError,
|
|
19
|
+
CouldNotReachURLError,
|
|
20
|
+
FileDoesNotExistError,
|
|
21
|
+
HTTPError,
|
|
22
|
+
InvalidItemFieldsError,
|
|
23
|
+
MissingCredentialsError,
|
|
24
|
+
ParamNotPassedError,
|
|
25
|
+
PreConditionFailedError,
|
|
26
|
+
PreConditionRequiredError,
|
|
27
|
+
PyZoteroError,
|
|
28
|
+
RequestEntityTooLargeError,
|
|
29
|
+
ResourceNotFoundError,
|
|
30
|
+
TooManyItemsError,
|
|
31
|
+
TooManyRequestsError,
|
|
32
|
+
TooManyRetriesError,
|
|
33
|
+
UnsupportedParamsError,
|
|
34
|
+
UploadError,
|
|
35
|
+
UserNotAuthorisedError,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
# Exceptions
|
|
40
|
+
"CallDoesNotExistError",
|
|
41
|
+
"ConflictError",
|
|
42
|
+
"CouldNotReachURLError",
|
|
43
|
+
"FileDoesNotExistError",
|
|
44
|
+
"HTTPError",
|
|
45
|
+
"InvalidItemFieldsError",
|
|
46
|
+
"MissingCredentialsError",
|
|
47
|
+
"ParamNotPassedError",
|
|
48
|
+
"PreConditionFailedError",
|
|
49
|
+
"PreConditionRequiredError",
|
|
50
|
+
"PyZoteroError",
|
|
51
|
+
"RequestEntityTooLargeError",
|
|
52
|
+
"ResourceNotFoundError",
|
|
53
|
+
"SavedSearch",
|
|
54
|
+
"TooManyItemsError",
|
|
55
|
+
"TooManyRequestsError",
|
|
56
|
+
"TooManyRetriesError",
|
|
57
|
+
"UnsupportedParamsError",
|
|
58
|
+
"UploadError",
|
|
59
|
+
"UserNotAuthorisedError",
|
|
60
|
+
# Main classes
|
|
61
|
+
"Zotero",
|
|
62
|
+
"Zupload",
|
|
63
|
+
# Version
|
|
64
|
+
"__version__",
|
|
65
|
+
# Utilities
|
|
66
|
+
"chunks",
|
|
67
|
+
]
|