pyzotero 1.6.9__tar.gz → 1.6.11__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.9 → pyzotero-1.6.11}/PKG-INFO +3 -2
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/_version.py +9 -4
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero/zotero.py +9 -9
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero.egg-info/PKG-INFO +3 -2
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.coveragerc +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.github/ISSUE_TEMPLATE/usage_question.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.github/dependabot.yml +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.github/pull_request_template.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.github/workflows/tests.yml +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.gitignore +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/.readthedocs.yaml +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/AUTHORS +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/CITATION.cff +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/CONTRIBUTING.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/CONTRIBUTORS.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/LICENSE.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/README.md +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/__init__.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/doc/Makefile +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/doc/_templates/layout.html +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/doc/cat.png +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/doc/conf.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/doc/index.rst +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/dump_contributors.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/example/.gitignore +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/example/local_base_use.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/example/local_copy_pdf.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/example/local_get_item_detail.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/example/local_search_title.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/pyproject.toml +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/setup.cfg +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/setup.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero/__init__.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero/filetransport.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero/zotero_errors.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero.egg-info/SOURCES.txt +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero.egg-info/dependency_links.txt +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero.egg-info/requires.txt +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/src/pyzotero.egg-info/top_level.txt +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/__init__.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/attachments_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/citation_doc.xml +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/collection_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/collection_tags.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/collection_versions.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/collections_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/creation_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/groups_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_fields.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_file.pdf +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_template.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_types.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/item_versions.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/items_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/keys_doc.txt +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/api_responses/tags_doc.json +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/test_async.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/tests/test_zotero.py +0 -0
- {pyzotero-1.6.9 → pyzotero-1.6.11}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.11
|
|
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
|
|
@@ -71,6 +71,7 @@ Requires-Dist: python-dateutil; extra == "test"
|
|
|
71
71
|
Requires-Dist: ipython; extra == "test"
|
|
72
72
|
Requires-Dist: pytest-asyncio; extra == "test"
|
|
73
73
|
Requires-Dist: pytest-cov>=6.0.0; extra == "test"
|
|
74
|
+
Dynamic: license-file
|
|
74
75
|
|
|
75
76
|
[](https://pypi.python.org/pypi/Pyzotero/) [](http://pyzotero.readthedocs.org/en/latest/?badge=latest) [](https://pypi.python.org/pypi/Pyzotero) [](https://anaconda.org/conda-forge/pyzotero) [](https://pepy.tech/project/pyzotero)
|
|
76
77
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
# file generated by
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
5
|
+
|
|
3
6
|
TYPE_CHECKING = False
|
|
4
7
|
if TYPE_CHECKING:
|
|
5
|
-
from typing import Tuple
|
|
8
|
+
from typing import Tuple
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
6
11
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
12
|
else:
|
|
8
13
|
VERSION_TUPLE = object
|
|
@@ -12,5 +17,5 @@ __version__: str
|
|
|
12
17
|
__version_tuple__: VERSION_TUPLE
|
|
13
18
|
version_tuple: VERSION_TUPLE
|
|
14
19
|
|
|
15
|
-
__version__ = version = '1.6.
|
|
16
|
-
__version_tuple__ = version_tuple = (1, 6,
|
|
20
|
+
__version__ = version = '1.6.11'
|
|
21
|
+
__version_tuple__ = version_tuple = (1, 6, 11)
|
|
@@ -800,7 +800,7 @@ class Zotero:
|
|
|
800
800
|
if self.snapshot:
|
|
801
801
|
self.snapshot = False
|
|
802
802
|
pth += ".zip"
|
|
803
|
-
with Path.open(
|
|
803
|
+
with Path(pth).open("wb") as f:
|
|
804
804
|
f.write(file)
|
|
805
805
|
|
|
806
806
|
@retrieve
|
|
@@ -1398,7 +1398,7 @@ class Zotero:
|
|
|
1398
1398
|
orig = self._attachment_template("imported_file")
|
|
1399
1399
|
to_add = [orig.copy() for fls in files]
|
|
1400
1400
|
for idx, tmplt in enumerate(to_add):
|
|
1401
|
-
tmplt["title"] = Path
|
|
1401
|
+
tmplt["title"] = Path(files[idx]).name
|
|
1402
1402
|
tmplt["filename"] = files[idx]
|
|
1403
1403
|
if parentid:
|
|
1404
1404
|
return self._attachment(to_add, parentid)
|
|
@@ -1851,10 +1851,10 @@ class Zupload:
|
|
|
1851
1851
|
if not payload: # Check payload has nonzero length
|
|
1852
1852
|
raise ze.ParamNotPassedError
|
|
1853
1853
|
for templt in payload:
|
|
1854
|
-
if Path
|
|
1854
|
+
if Path(str(self.basedir.joinpath(templt["filename"]))).is_file():
|
|
1855
1855
|
try:
|
|
1856
1856
|
# if it is a file, try to open it, and catch the error
|
|
1857
|
-
with Path
|
|
1857
|
+
with Path(str(self.basedir.joinpath(templt["filename"]))).open():
|
|
1858
1858
|
pass
|
|
1859
1859
|
except OSError:
|
|
1860
1860
|
msg = f"The file at {self.basedir.joinpath(templt['filename'])!s} couldn't be opened or found."
|
|
@@ -1914,7 +1914,7 @@ class Zupload:
|
|
|
1914
1914
|
"""Step 1: get upload authorisation for a file"""
|
|
1915
1915
|
mtypes = mimetypes.guess_type(attachment)
|
|
1916
1916
|
digest = hashlib.md5() # noqa: S324
|
|
1917
|
-
with Path.open(
|
|
1917
|
+
with Path(attachment).open("rb") as att:
|
|
1918
1918
|
for chunk in iter(lambda: att.read(8192), b""):
|
|
1919
1919
|
digest.update(chunk)
|
|
1920
1920
|
auth_headers = {"Content-Type": "application/x-www-form-urlencoded"}
|
|
@@ -1925,9 +1925,9 @@ class Zupload:
|
|
|
1925
1925
|
auth_headers["If-Match"] = md5
|
|
1926
1926
|
data = {
|
|
1927
1927
|
"md5": digest.hexdigest(),
|
|
1928
|
-
"filename": Path
|
|
1929
|
-
"filesize": Path.stat().st_size
|
|
1930
|
-
"mtime": str(int(Path.stat().st_mtime
|
|
1928
|
+
"filename": Path(attachment).name,
|
|
1929
|
+
"filesize": Path(attachment).stat().st_size,
|
|
1930
|
+
"mtime": str(int(Path(attachment).stat().st_mtime * 1000)),
|
|
1931
1931
|
"contentType": mtypes[0] or "application/octet-stream",
|
|
1932
1932
|
"charset": mtypes[1],
|
|
1933
1933
|
"params": 1,
|
|
@@ -1961,7 +1961,7 @@ class Zupload:
|
|
|
1961
1961
|
upload_list = [("key", upload_dict.pop("key"))]
|
|
1962
1962
|
for key, value in upload_dict.items():
|
|
1963
1963
|
upload_list.append((key, value))
|
|
1964
|
-
upload_list.append(("file", Path.open(
|
|
1964
|
+
upload_list.append(("file", Path(attachment).open("rb").read()))
|
|
1965
1965
|
upload_pairs = tuple(upload_list)
|
|
1966
1966
|
try:
|
|
1967
1967
|
self.zinstance._check_backoff()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pyzotero
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.11
|
|
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
|
|
@@ -71,6 +71,7 @@ Requires-Dist: python-dateutil; extra == "test"
|
|
|
71
71
|
Requires-Dist: ipython; extra == "test"
|
|
72
72
|
Requires-Dist: pytest-asyncio; extra == "test"
|
|
73
73
|
Requires-Dist: pytest-cov>=6.0.0; extra == "test"
|
|
74
|
+
Dynamic: license-file
|
|
74
75
|
|
|
75
76
|
[](https://pypi.python.org/pypi/Pyzotero/) [](http://pyzotero.readthedocs.org/en/latest/?badge=latest) [](https://pypi.python.org/pypi/Pyzotero) [](https://anaconda.org/conda-forge/pyzotero) [](https://pepy.tech/project/pyzotero)
|
|
76
77
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|