pyzotero 1.6.2__tar.gz → 1.6.4__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.6.2 → pyzotero-1.6.4}/PKG-INFO +3 -3
- {pyzotero-1.6.2 → pyzotero-1.6.4}/pyproject.toml +2 -2
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/_version.py +2 -2
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero/zotero.py +43 -18
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero.egg-info/PKG-INFO +3 -3
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.coveragerc +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.github/ISSUE_TEMPLATE/usage_question.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.github/dependabot.yml +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.github/pull_request_template.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.github/workflows/tests.yml +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.gitignore +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/.readthedocs.yaml +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/AUTHORS +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/CITATION.cff +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/CONTRIBUTING.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/CONTRIBUTORS.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/LICENSE.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/README.md +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/__init__.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/doc/Makefile +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/doc/_templates/layout.html +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/doc/cat.png +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/doc/conf.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/doc/index.rst +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/dump_contributors.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/setup.cfg +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/setup.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero/__init__.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero/zotero_errors.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero.egg-info/SOURCES.txt +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero.egg-info/dependency_links.txt +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero.egg-info/requires.txt +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/src/pyzotero.egg-info/top_level.txt +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/__init__.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/attachments_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/citation_doc.xml +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/collection_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/collection_tags.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/collection_versions.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/collections_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/creation_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/groups_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_fields.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_file.pdf +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_template.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_types.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/item_versions.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/items_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/keys_doc.txt +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/api_responses/tags_doc.json +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/tests/test_zotero.py +0 -0
- {pyzotero-1.6.2 → pyzotero-1.6.4}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.4
|
|
4
4
|
Summary: Python wrapper for the Zotero API
|
|
5
5
|
Author-email: Stephan Hügel <urschrei@gmail.com>
|
|
6
6
|
License: # Blue Oak Model License
|
|
@@ -43,11 +43,11 @@ Project-URL: Repository, https://github.com/urschrei/pyzotero
|
|
|
43
43
|
Project-URL: Tracker, https://github.com/urschrei/pyzotero/issues
|
|
44
44
|
Keywords: Zotero,DH
|
|
45
45
|
Classifier: Programming Language :: Python
|
|
46
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.9
|
|
48
47
|
Classifier: Programming Language :: Python :: 3.10
|
|
49
48
|
Classifier: Programming Language :: Python :: 3.11
|
|
50
49
|
Classifier: Programming Language :: Python :: 3.12
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
51
51
|
Classifier: Development Status :: 5 - Production/Stable
|
|
52
52
|
Classifier: Intended Audience :: Developers
|
|
53
53
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -55,7 +55,7 @@ Classifier: Intended Audience :: Education
|
|
|
55
55
|
Classifier: License :: OSI Approved :: Blue Oak Model License (BlueOak-1.0.0)
|
|
56
56
|
Classifier: Operating System :: OS Independent
|
|
57
57
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
58
|
-
Requires-Python: >=3.
|
|
58
|
+
Requires-Python: >=3.9
|
|
59
59
|
Description-Content-Type: text/markdown
|
|
60
60
|
License-File: LICENSE.md
|
|
61
61
|
License-File: AUTHORS
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name = "pyzotero"
|
|
3
3
|
dynamic = ["version", "readme"]
|
|
4
4
|
description = "Python wrapper for the Zotero API"
|
|
5
|
-
requires-python = ">=3.
|
|
5
|
+
requires-python = ">=3.9"
|
|
6
6
|
dependencies = [
|
|
7
7
|
"feedparser >= 6.0.11",
|
|
8
8
|
"pytz",
|
|
@@ -14,11 +14,11 @@ license = {file = "LICENSE.md"}
|
|
|
14
14
|
keywords = ["Zotero", "DH"]
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Programming Language :: Python",
|
|
17
|
-
"Programming Language :: Python :: 3.8",
|
|
18
17
|
"Programming Language :: Python :: 3.9",
|
|
19
18
|
"Programming Language :: Python :: 3.10",
|
|
20
19
|
"Programming Language :: Python :: 3.11",
|
|
21
20
|
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
22
|
"Development Status :: 5 - Production/Stable",
|
|
23
23
|
"Intended Audience :: Developers",
|
|
24
24
|
"Intended Audience :: Science/Research",
|
|
@@ -62,6 +62,23 @@ def build_url(base_url, path, args_dict=None):
|
|
|
62
62
|
return urlunparse(url_parts)
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
def merge_params(url, params):
|
|
66
|
+
"""This function strips query parameters, extracting them into a dict, then merging it with
|
|
67
|
+
the "params" dict, returning the truncated url and merged query params dict"""
|
|
68
|
+
parsed = urlparse(url)
|
|
69
|
+
# Extract query parameters from URL
|
|
70
|
+
incoming = parse_qs(parsed.query)
|
|
71
|
+
incoming = {k: v[0] for k, v in incoming.items()}
|
|
72
|
+
|
|
73
|
+
# Create new params dict by merging
|
|
74
|
+
merged = {**incoming, **params}
|
|
75
|
+
|
|
76
|
+
# Get base URL by zeroing out the query component
|
|
77
|
+
base_url = urlunparse(parsed._replace(query=""))
|
|
78
|
+
|
|
79
|
+
return base_url, merged
|
|
80
|
+
|
|
81
|
+
|
|
65
82
|
def token():
|
|
66
83
|
"""Return a unique 32-char write-token"""
|
|
67
84
|
return str(uuid.uuid4().hex)
|
|
@@ -458,7 +475,16 @@ class Zotero:
|
|
|
458
475
|
if not self.url_params:
|
|
459
476
|
self.url_params = {}
|
|
460
477
|
merged_params = params | self.url_params
|
|
461
|
-
|
|
478
|
+
# our incoming url might be from the "links" dict, in which case it will contain url parameters.
|
|
479
|
+
# Unfortunately, httpx doesn't like to merge query paramaters in the url string and passed params
|
|
480
|
+
# so we strip the url params, combining them with our existing url_params
|
|
481
|
+
final_url, final_params = merge_params(full_url, merged_params)
|
|
482
|
+
self.request = self.client.get(
|
|
483
|
+
url=final_url,
|
|
484
|
+
params=final_params,
|
|
485
|
+
headers=self.default_headers(),
|
|
486
|
+
timeout=timeout,
|
|
487
|
+
)
|
|
462
488
|
self.request.encoding = "utf-8"
|
|
463
489
|
try:
|
|
464
490
|
self.request.raise_for_status()
|
|
@@ -660,7 +686,7 @@ class Zotero:
|
|
|
660
686
|
),
|
|
661
687
|
),
|
|
662
688
|
headers=headers,
|
|
663
|
-
|
|
689
|
+
data=json.dumps(payload),
|
|
664
690
|
)
|
|
665
691
|
|
|
666
692
|
def new_fulltext(self, since):
|
|
@@ -894,7 +920,6 @@ class Zotero:
|
|
|
894
920
|
"""Return the result of the call to the URL in the 'Next' link"""
|
|
895
921
|
if n := self.links.get("next"):
|
|
896
922
|
newurl = self._striplocal(n)
|
|
897
|
-
print(newurl)
|
|
898
923
|
return newurl
|
|
899
924
|
return
|
|
900
925
|
|
|
@@ -1022,7 +1047,7 @@ class Zotero:
|
|
|
1022
1047
|
linked_file
|
|
1023
1048
|
linked_url
|
|
1024
1049
|
"""
|
|
1025
|
-
return self.item_template("attachment
|
|
1050
|
+
return self.item_template("attachment", linkmode=attachment_type)
|
|
1026
1051
|
|
|
1027
1052
|
def _attachment(self, payload, parentid=None):
|
|
1028
1053
|
"""
|
|
@@ -1072,7 +1097,7 @@ class Zotero:
|
|
|
1072
1097
|
"/{t}/{u}/searches".format(t=self.library_type, u=self.library_id),
|
|
1073
1098
|
),
|
|
1074
1099
|
headers=headers,
|
|
1075
|
-
|
|
1100
|
+
data=json.dumps(payload),
|
|
1076
1101
|
)
|
|
1077
1102
|
self.request = req
|
|
1078
1103
|
try:
|
|
@@ -1274,7 +1299,7 @@ class Zotero:
|
|
|
1274
1299
|
self.endpoint,
|
|
1275
1300
|
"/{t}/{u}/items".format(t=self.library_type, u=self.library_id),
|
|
1276
1301
|
),
|
|
1277
|
-
|
|
1302
|
+
data=to_send,
|
|
1278
1303
|
headers=dict(headers),
|
|
1279
1304
|
)
|
|
1280
1305
|
self.request = req
|
|
@@ -1305,7 +1330,7 @@ class Zotero:
|
|
|
1305
1330
|
t=self.library_type, u=self.library_id, v=value
|
|
1306
1331
|
),
|
|
1307
1332
|
),
|
|
1308
|
-
|
|
1333
|
+
data=payload,
|
|
1309
1334
|
headers=dict(uheaders),
|
|
1310
1335
|
)
|
|
1311
1336
|
self.request = presp
|
|
@@ -1349,7 +1374,7 @@ class Zotero:
|
|
|
1349
1374
|
"/{t}/{u}/collections".format(t=self.library_type, u=self.library_id),
|
|
1350
1375
|
),
|
|
1351
1376
|
headers=headers,
|
|
1352
|
-
|
|
1377
|
+
data=json.dumps(payload),
|
|
1353
1378
|
)
|
|
1354
1379
|
self.request = req
|
|
1355
1380
|
try:
|
|
@@ -1382,7 +1407,7 @@ class Zotero:
|
|
|
1382
1407
|
),
|
|
1383
1408
|
),
|
|
1384
1409
|
headers=headers,
|
|
1385
|
-
|
|
1410
|
+
data=json.dumps(payload),
|
|
1386
1411
|
)
|
|
1387
1412
|
|
|
1388
1413
|
def attachment_simple(self, files, parentid=None):
|
|
@@ -1440,7 +1465,7 @@ class Zotero:
|
|
|
1440
1465
|
),
|
|
1441
1466
|
),
|
|
1442
1467
|
headers=headers,
|
|
1443
|
-
|
|
1468
|
+
data=json.dumps(to_send),
|
|
1444
1469
|
)
|
|
1445
1470
|
|
|
1446
1471
|
def update_items(self, payload):
|
|
@@ -1458,7 +1483,7 @@ class Zotero:
|
|
|
1458
1483
|
self.endpoint,
|
|
1459
1484
|
"/{t}/{u}/items/".format(t=self.library_type, u=self.library_id),
|
|
1460
1485
|
),
|
|
1461
|
-
|
|
1486
|
+
data=json.dumps(chunk),
|
|
1462
1487
|
)
|
|
1463
1488
|
self.request = req
|
|
1464
1489
|
try:
|
|
@@ -1487,7 +1512,7 @@ class Zotero:
|
|
|
1487
1512
|
t=self.library_type, u=self.library_id
|
|
1488
1513
|
),
|
|
1489
1514
|
),
|
|
1490
|
-
|
|
1515
|
+
data=json.dumps(chunk),
|
|
1491
1516
|
)
|
|
1492
1517
|
self.request = req
|
|
1493
1518
|
try:
|
|
@@ -1518,7 +1543,7 @@ class Zotero:
|
|
|
1518
1543
|
t=self.library_type, u=self.library_id, i=ident
|
|
1519
1544
|
),
|
|
1520
1545
|
),
|
|
1521
|
-
|
|
1546
|
+
data=json.dumps({"collections": modified_collections}),
|
|
1522
1547
|
headers=headers,
|
|
1523
1548
|
)
|
|
1524
1549
|
|
|
@@ -1543,7 +1568,7 @@ class Zotero:
|
|
|
1543
1568
|
t=self.library_type, u=self.library_id, i=ident
|
|
1544
1569
|
),
|
|
1545
1570
|
),
|
|
1546
|
-
|
|
1571
|
+
data=json.dumps({"collections": modified_collections}),
|
|
1547
1572
|
headers=headers,
|
|
1548
1573
|
)
|
|
1549
1574
|
|
|
@@ -1907,14 +1932,14 @@ class Zupload:
|
|
|
1907
1932
|
child["parentItem"] = self.parentid
|
|
1908
1933
|
to_send = json.dumps(self.payload)
|
|
1909
1934
|
self.zinstance._check_backoff()
|
|
1910
|
-
req = self.client.post(
|
|
1935
|
+
req = self.zinstance.client.post(
|
|
1911
1936
|
url=build_url(
|
|
1912
1937
|
self.zinstance.endpoint,
|
|
1913
1938
|
liblevel.format(
|
|
1914
1939
|
t=self.zinstance.library_type, u=self.zinstance.library_id
|
|
1915
1940
|
),
|
|
1916
1941
|
),
|
|
1917
|
-
|
|
1942
|
+
data=to_send,
|
|
1918
1943
|
headers=headers,
|
|
1919
1944
|
)
|
|
1920
1945
|
try:
|
|
@@ -1963,7 +1988,7 @@ class Zupload:
|
|
|
1963
1988
|
i=reg_key,
|
|
1964
1989
|
),
|
|
1965
1990
|
),
|
|
1966
|
-
|
|
1991
|
+
data=data,
|
|
1967
1992
|
headers=auth_headers,
|
|
1968
1993
|
)
|
|
1969
1994
|
try:
|
|
@@ -2027,7 +2052,7 @@ class Zupload:
|
|
|
2027
2052
|
i=reg_key,
|
|
2028
2053
|
),
|
|
2029
2054
|
),
|
|
2030
|
-
|
|
2055
|
+
data=reg_data,
|
|
2031
2056
|
headers=dict(reg_headers),
|
|
2032
2057
|
)
|
|
2033
2058
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.4
|
|
4
4
|
Summary: Python wrapper for the Zotero API
|
|
5
5
|
Author-email: Stephan Hügel <urschrei@gmail.com>
|
|
6
6
|
License: # Blue Oak Model License
|
|
@@ -43,11 +43,11 @@ Project-URL: Repository, https://github.com/urschrei/pyzotero
|
|
|
43
43
|
Project-URL: Tracker, https://github.com/urschrei/pyzotero/issues
|
|
44
44
|
Keywords: Zotero,DH
|
|
45
45
|
Classifier: Programming Language :: Python
|
|
46
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.9
|
|
48
47
|
Classifier: Programming Language :: Python :: 3.10
|
|
49
48
|
Classifier: Programming Language :: Python :: 3.11
|
|
50
49
|
Classifier: Programming Language :: Python :: 3.12
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
51
51
|
Classifier: Development Status :: 5 - Production/Stable
|
|
52
52
|
Classifier: Intended Audience :: Developers
|
|
53
53
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -55,7 +55,7 @@ Classifier: Intended Audience :: Education
|
|
|
55
55
|
Classifier: License :: OSI Approved :: Blue Oak Model License (BlueOak-1.0.0)
|
|
56
56
|
Classifier: Operating System :: OS Independent
|
|
57
57
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
58
|
-
Requires-Python: >=3.
|
|
58
|
+
Requires-Python: >=3.9
|
|
59
59
|
Description-Content-Type: text/markdown
|
|
60
60
|
License-File: LICENSE.md
|
|
61
61
|
License-File: AUTHORS
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|