pyzotero 1.6.2__py3-none-any.whl → 1.6.3__py3-none-any.whl
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.
- _version.py +2 -2
- pyzotero/zotero.py +27 -2
- {pyzotero-1.6.2.dist-info → pyzotero-1.6.3.dist-info}/METADATA +3 -3
- pyzotero-1.6.3.dist-info/RECORD +10 -0
- {pyzotero-1.6.2.dist-info → pyzotero-1.6.3.dist-info}/WHEEL +1 -1
- pyzotero-1.6.2.dist-info/RECORD +0 -10
- {pyzotero-1.6.2.dist-info → pyzotero-1.6.3.dist-info}/AUTHORS +0 -0
- {pyzotero-1.6.2.dist-info → pyzotero-1.6.3.dist-info}/LICENSE.md +0 -0
- {pyzotero-1.6.2.dist-info → pyzotero-1.6.3.dist-info}/top_level.txt +0 -0
_version.py
CHANGED
pyzotero/zotero.py
CHANGED
|
@@ -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()
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.3
|
|
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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
_version.py,sha256=mQ_8947spH9F9E4bJgRMJ3LZK_sGORi1ak9UVDzTrr8,411
|
|
2
|
+
pyzotero/__init__.py,sha256=5QI4Jou9L-YJAf_oN9TgRXVKgt_Unc39oADo2Ch8bLI,243
|
|
3
|
+
pyzotero/zotero.py,sha256=xR7pbpvNjhLteNWfUUe56WmVEy73I0YsqcoXnW2LWhc,76408
|
|
4
|
+
pyzotero/zotero_errors.py,sha256=UPhAmf2K05cnoeIl2wjufWQedepg7vBKb-ShU0TdlL4,2582
|
|
5
|
+
pyzotero-1.6.3.dist-info/AUTHORS,sha256=ZMicxg7lRScOYbxzMPznlzMbmrFIUIHwg-NvljEMbRQ,110
|
|
6
|
+
pyzotero-1.6.3.dist-info/LICENSE.md,sha256=bhy1CPMj1zWffD9YifFmSeBzPylsrhb1qP8OCEx5Etw,1550
|
|
7
|
+
pyzotero-1.6.3.dist-info/METADATA,sha256=_sSykeMd0j3ndkriUjdoKsCain3uIxMhAqSY9vhnlm8,7290
|
|
8
|
+
pyzotero-1.6.3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
|
9
|
+
pyzotero-1.6.3.dist-info/top_level.txt,sha256=BOPNkPk5VtNDCy_li7Xftx6k0zG8STGxh-KgckcxLEw,18
|
|
10
|
+
pyzotero-1.6.3.dist-info/RECORD,,
|
pyzotero-1.6.2.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
_version.py,sha256=ay9A4GSmtr3NioHirRgXvWfXtjwRjzXIO_WPuFobCoI,411
|
|
2
|
-
pyzotero/__init__.py,sha256=5QI4Jou9L-YJAf_oN9TgRXVKgt_Unc39oADo2Ch8bLI,243
|
|
3
|
-
pyzotero/zotero.py,sha256=jnfqgwbn2nMxUnUNG98dm--AlE6CaLyJCuOizXOvJz4,75376
|
|
4
|
-
pyzotero/zotero_errors.py,sha256=UPhAmf2K05cnoeIl2wjufWQedepg7vBKb-ShU0TdlL4,2582
|
|
5
|
-
pyzotero-1.6.2.dist-info/AUTHORS,sha256=ZMicxg7lRScOYbxzMPznlzMbmrFIUIHwg-NvljEMbRQ,110
|
|
6
|
-
pyzotero-1.6.2.dist-info/LICENSE.md,sha256=bhy1CPMj1zWffD9YifFmSeBzPylsrhb1qP8OCEx5Etw,1550
|
|
7
|
-
pyzotero-1.6.2.dist-info/METADATA,sha256=aFEP8H1c0A7W75pQO_qBh6HNNcqDmnlRZ47llubffwc,7289
|
|
8
|
-
pyzotero-1.6.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
9
|
-
pyzotero-1.6.2.dist-info/top_level.txt,sha256=BOPNkPk5VtNDCy_li7Xftx6k0zG8STGxh-KgckcxLEw,18
|
|
10
|
-
pyzotero-1.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|