python-documentcloud 4.4.0__py2.py3-none-any.whl → 4.4.1__py2.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.
- documentcloud/client.py +8 -4
- documentcloud/documents.py +13 -7
- {python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info}/METADATA +3 -2
- {python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info}/RECORD +7 -7
- {python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info}/WHEEL +1 -1
- {python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info/licenses}/LICENSE +0 -0
- {python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info}/top_level.txt +0 -0
documentcloud/client.py
CHANGED
|
@@ -14,12 +14,11 @@ from .users import UserClient
|
|
|
14
14
|
|
|
15
15
|
logger = logging.getLogger("documentcloud")
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
class DocumentCloud(SquareletClient):
|
|
19
18
|
"""
|
|
20
19
|
The public interface for the DocumentCloud API, now integrated with SquareletClient
|
|
21
20
|
"""
|
|
22
|
-
|
|
21
|
+
# pylint:disable=too-many-positional-arguments
|
|
23
22
|
def __init__(
|
|
24
23
|
self,
|
|
25
24
|
username=None,
|
|
@@ -31,7 +30,7 @@ class DocumentCloud(SquareletClient):
|
|
|
31
30
|
rate_limit=True,
|
|
32
31
|
rate_limit_sleep=True,
|
|
33
32
|
):
|
|
34
|
-
|
|
33
|
+
# Initialize SquareletClient for authentication and request handling
|
|
35
34
|
super().__init__(
|
|
36
35
|
base_uri=base_uri,
|
|
37
36
|
username=username,
|
|
@@ -39,7 +38,7 @@ class DocumentCloud(SquareletClient):
|
|
|
39
38
|
auth_uri=auth_uri,
|
|
40
39
|
timeout=timeout,
|
|
41
40
|
rate_limit=rate_limit,
|
|
42
|
-
rate_limit_sleep=rate_limit_sleep
|
|
41
|
+
rate_limit_sleep=rate_limit_sleep
|
|
43
42
|
)
|
|
44
43
|
|
|
45
44
|
# Set up logging
|
|
@@ -56,3 +55,8 @@ class DocumentCloud(SquareletClient):
|
|
|
56
55
|
self.projects = ProjectClient(self)
|
|
57
56
|
self.users = UserClient(self)
|
|
58
57
|
self.organizations = OrganizationClient(self)
|
|
58
|
+
|
|
59
|
+
"""def _request(self, method, url, raise_error=True, **kwargs):
|
|
60
|
+
Delegates request to the SquareletClient's _request method
|
|
61
|
+
return self.squarelet_client.request(method, url, raise_error, **kwargs)
|
|
62
|
+
"""
|
documentcloud/documents.py
CHANGED
|
@@ -74,7 +74,7 @@ class Document(BaseAPIObject):
|
|
|
74
74
|
def __getattr__(self, attr):
|
|
75
75
|
"""Generate methods for fetching resources"""
|
|
76
76
|
p_image = re.compile(
|
|
77
|
-
r"^get_(?P<size>thumbnail|small|normal|large)_image_url(?P<list>_list)?$"
|
|
77
|
+
r"^get_(?P<size>thumbnail|small|normal|large|xlarge)_image_url(?P<list>_list)?$"
|
|
78
78
|
)
|
|
79
79
|
get = attr.startswith("get_")
|
|
80
80
|
url = attr.endswith("_url")
|
|
@@ -404,7 +404,9 @@ class DocumentClient(BaseAPIClient):
|
|
|
404
404
|
path_list = self._collect_files(path, extensions)
|
|
405
405
|
|
|
406
406
|
logger.info(
|
|
407
|
-
"Upload directory on %s: Found %d files to upload",
|
|
407
|
+
"Upload directory on %s: Found %d files to upload",
|
|
408
|
+
path,
|
|
409
|
+
len(path_list)
|
|
408
410
|
)
|
|
409
411
|
|
|
410
412
|
# Upload all the files using the bulk API to reduce the number
|
|
@@ -442,7 +444,7 @@ class DocumentClient(BaseAPIClient):
|
|
|
442
444
|
logger.info(
|
|
443
445
|
"Error creating the following documents: %s\n%s",
|
|
444
446
|
exc,
|
|
445
|
-
"\n".join(file_paths)
|
|
447
|
+
"\n".join(file_paths)
|
|
446
448
|
)
|
|
447
449
|
continue
|
|
448
450
|
else:
|
|
@@ -463,7 +465,7 @@ class DocumentClient(BaseAPIClient):
|
|
|
463
465
|
logger.info(
|
|
464
466
|
"Error uploading the following document: %s %s",
|
|
465
467
|
exc,
|
|
466
|
-
file_path
|
|
468
|
+
file_path
|
|
467
469
|
)
|
|
468
470
|
continue
|
|
469
471
|
else:
|
|
@@ -479,7 +481,7 @@ class DocumentClient(BaseAPIClient):
|
|
|
479
481
|
logger.info(
|
|
480
482
|
"Error creating the following documents: %s\n%s",
|
|
481
483
|
exc,
|
|
482
|
-
"\n".join(file_paths)
|
|
484
|
+
"\n".join(file_paths)
|
|
483
485
|
)
|
|
484
486
|
continue
|
|
485
487
|
else:
|
|
@@ -502,7 +504,11 @@ class DocumentClient(BaseAPIClient):
|
|
|
502
504
|
# Grouper will put None's on the end of the last group
|
|
503
505
|
url_group = [url for url in url_group if url is not None]
|
|
504
506
|
|
|
505
|
-
logger.info(
|
|
507
|
+
logger.info(
|
|
508
|
+
"Uploading group %d: %s",
|
|
509
|
+
i + 1,
|
|
510
|
+
"\n".join(url_group)
|
|
511
|
+
)
|
|
506
512
|
|
|
507
513
|
# Create the documents
|
|
508
514
|
logger.info("Creating the documents...")
|
|
@@ -525,7 +531,7 @@ class DocumentClient(BaseAPIClient):
|
|
|
525
531
|
logger.info(
|
|
526
532
|
"Error creating the following documents: %s\n%s",
|
|
527
533
|
str(exc),
|
|
528
|
-
"\n".join(url_group)
|
|
534
|
+
"\n".join(url_group)
|
|
529
535
|
)
|
|
530
536
|
continue
|
|
531
537
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-documentcloud
|
|
3
|
-
Version: 4.4.
|
|
3
|
+
Version: 4.4.1
|
|
4
4
|
Summary: A simple Python wrapper for the DocumentCloud API
|
|
5
5
|
Home-page: https://github.com/muckrock/python-documentcloud
|
|
6
6
|
Author: Mitchell Kotler
|
|
@@ -46,6 +46,7 @@ Dynamic: description
|
|
|
46
46
|
Dynamic: description-content-type
|
|
47
47
|
Dynamic: home-page
|
|
48
48
|
Dynamic: license
|
|
49
|
+
Dynamic: license-file
|
|
49
50
|
Dynamic: provides-extra
|
|
50
51
|
Dynamic: requires-dist
|
|
51
52
|
Dynamic: summary
|
|
@@ -2,17 +2,17 @@ documentcloud/__init__.py,sha256=XAwOR6JYL-flQV_uC616AMA2rYiXTkeogNolqE6LzN4,220
|
|
|
2
2
|
documentcloud/addon.py,sha256=3FxQjm26jknjLdd-GuztiZO4Z7NcgXq4WqunE9oh2es,11754
|
|
3
3
|
documentcloud/annotations.py,sha256=wVe3wYzyTRvc_hJ3r0m6iyDf6WIFlaGcCnyah_r53pg,2538
|
|
4
4
|
documentcloud/base.py,sha256=pNF45aleYpQ9fj75CiL3c4Ssv6MO1EmdzZ6wBLPKHDg,6545
|
|
5
|
-
documentcloud/client.py,sha256=
|
|
5
|
+
documentcloud/client.py,sha256=OBL2a-n9RMbQns3dImTWrnrCjyr17KKJuTlY9OU7ztI,1933
|
|
6
6
|
documentcloud/constants.py,sha256=h6NStSkxPrjQ2gzaIlqftCF7tthkRimddOE8SsmlHag,1828
|
|
7
|
-
documentcloud/documents.py,sha256=
|
|
7
|
+
documentcloud/documents.py,sha256=6OUXu-pThJoRe6OSKdOi6UHlHA1NdQxqfhDps20g-8I,19570
|
|
8
8
|
documentcloud/exceptions.py,sha256=AwIJpcylq6sF6oaenrZE6nr2EBuj23nxTOf3z_RwtuE,461
|
|
9
9
|
documentcloud/organizations.py,sha256=_Ot6MWzoa5JdU3jqedU-0Fec_K8WrgxqdlIp4oIijes,392
|
|
10
10
|
documentcloud/projects.py,sha256=KuOiw65a-8fdgbjo7BqjbEbWguds8inkhFJZJd578bs,5328
|
|
11
11
|
documentcloud/sections.py,sha256=cMf973KMvp6fAPSMXCD67L32Pz1_Tfh81oV2q2UQ9Uk,924
|
|
12
12
|
documentcloud/toolbox.py,sha256=zFZTyOn40YZjBpqa1H3qjpR4C3Wu1X2g72AvH_ljlic,1835
|
|
13
13
|
documentcloud/users.py,sha256=yydOXoEsfJlYqryZpXQ4G3aeRc5y_QCHqXd0dfF1aIc,354
|
|
14
|
-
python_documentcloud-4.4.
|
|
15
|
-
python_documentcloud-4.4.
|
|
16
|
-
python_documentcloud-4.4.
|
|
17
|
-
python_documentcloud-4.4.
|
|
18
|
-
python_documentcloud-4.4.
|
|
14
|
+
python_documentcloud-4.4.1.dist-info/licenses/LICENSE,sha256=Z1IBhHCzIeGR9F2iHtcLt2I2qoUhJ2pK139CAIAuFgo,1151
|
|
15
|
+
python_documentcloud-4.4.1.dist-info/METADATA,sha256=k85f5PeEGS11gWgHwu_xqc-aOeTGU1vSmO7rW9HBASo,2880
|
|
16
|
+
python_documentcloud-4.4.1.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
|
|
17
|
+
python_documentcloud-4.4.1.dist-info/top_level.txt,sha256=rzNW2vA9GqU5ipNQYSP1XJQ54ippjKXVIo9oMlM0Tm4,14
|
|
18
|
+
python_documentcloud-4.4.1.dist-info/RECORD,,
|
{python_documentcloud-4.4.0.dist-info → python_documentcloud-4.4.1.dist-info/licenses}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|