python-documentcloud 4.3.0__py2.py3-none-any.whl → 4.4.0__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 CHANGED
@@ -14,11 +14,12 @@ from .users import UserClient
14
14
 
15
15
  logger = logging.getLogger("documentcloud")
16
16
 
17
+
17
18
  class DocumentCloud(SquareletClient):
18
19
  """
19
20
  The public interface for the DocumentCloud API, now integrated with SquareletClient
20
21
  """
21
- # pylint:disable=too-many-positional-arguments
22
+
22
23
  def __init__(
23
24
  self,
24
25
  username=None,
@@ -30,7 +31,7 @@ class DocumentCloud(SquareletClient):
30
31
  rate_limit=True,
31
32
  rate_limit_sleep=True,
32
33
  ):
33
- # Initialize SquareletClient for authentication and request handling
34
+ # Initialize SquareletClient for authentication and request handling
34
35
  super().__init__(
35
36
  base_uri=base_uri,
36
37
  username=username,
@@ -38,7 +39,7 @@ class DocumentCloud(SquareletClient):
38
39
  auth_uri=auth_uri,
39
40
  timeout=timeout,
40
41
  rate_limit=rate_limit,
41
- rate_limit_sleep=rate_limit_sleep
42
+ rate_limit_sleep=rate_limit_sleep,
42
43
  )
43
44
 
44
45
  # Set up logging
@@ -55,8 +56,3 @@ class DocumentCloud(SquareletClient):
55
56
  self.projects = ProjectClient(self)
56
57
  self.users = UserClient(self)
57
58
  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
- """
@@ -404,9 +404,7 @@ 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",
408
- path,
409
- len(path_list)
407
+ "Upload directory on %s: Found %d files to upload", path, len(path_list)
410
408
  )
411
409
 
412
410
  # Upload all the files using the bulk API to reduce the number
@@ -444,7 +442,7 @@ class DocumentClient(BaseAPIClient):
444
442
  logger.info(
445
443
  "Error creating the following documents: %s\n%s",
446
444
  exc,
447
- "\n".join(file_paths)
445
+ "\n".join(file_paths),
448
446
  )
449
447
  continue
450
448
  else:
@@ -465,7 +463,7 @@ class DocumentClient(BaseAPIClient):
465
463
  logger.info(
466
464
  "Error uploading the following document: %s %s",
467
465
  exc,
468
- file_path
466
+ file_path,
469
467
  )
470
468
  continue
471
469
  else:
@@ -481,7 +479,7 @@ class DocumentClient(BaseAPIClient):
481
479
  logger.info(
482
480
  "Error creating the following documents: %s\n%s",
483
481
  exc,
484
- "\n".join(file_paths)
482
+ "\n".join(file_paths),
485
483
  )
486
484
  continue
487
485
  else:
@@ -504,11 +502,7 @@ class DocumentClient(BaseAPIClient):
504
502
  # Grouper will put None's on the end of the last group
505
503
  url_group = [url for url in url_group if url is not None]
506
504
 
507
- logger.info(
508
- "Uploading group %d: %s",
509
- i + 1,
510
- "\n".join(url_group)
511
- )
505
+ logger.info("Uploading group %d: %s", i + 1, "\n".join(url_group))
512
506
 
513
507
  # Create the documents
514
508
  logger.info("Creating the documents...")
@@ -531,7 +525,7 @@ class DocumentClient(BaseAPIClient):
531
525
  logger.info(
532
526
  "Error creating the following documents: %s\n%s",
533
527
  str(exc),
534
- "\n".join(url_group)
528
+ "\n".join(url_group),
535
529
  )
536
530
  continue
537
531
  else:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: python-documentcloud
3
- Version: 4.3.0
3
+ Version: 4.4.0
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
@@ -10,7 +10,6 @@ Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python :: 3.7
14
13
  Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
@@ -40,6 +39,16 @@ Requires-Dist: pytest; extra == "test"
40
39
  Requires-Dist: pytest-mock; extra == "test"
41
40
  Requires-Dist: pytest-recording; extra == "test"
42
41
  Requires-Dist: vcrpy; extra == "test"
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: license
49
+ Dynamic: provides-extra
50
+ Dynamic: requires-dist
51
+ Dynamic: summary
43
52
 
44
53
  <pre><code> ____ _ ____ _ _
45
54
  | _ \ ___ ___ _ _ _ __ ___ ___ _ __ | |_ / ___| | ___ _ _ __| |
@@ -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=OBL2a-n9RMbQns3dImTWrnrCjyr17KKJuTlY9OU7ztI,1933
5
+ documentcloud/client.py,sha256=WXHNE1BT-LE2E55XlOvPuWl_g5N0zUIdXvB7Qj_fMNc,1658
6
6
  documentcloud/constants.py,sha256=h6NStSkxPrjQ2gzaIlqftCF7tthkRimddOE8SsmlHag,1828
7
- documentcloud/documents.py,sha256=4OFcWpLgiAhAKpw7QJmswji8jkq2xk12XypfEKmotSk,19563
7
+ documentcloud/documents.py,sha256=CNEtdiDQ_Alcb3ruMfzlKn5QqWdn_PWicUWJlyxEaC0,19481
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.3.0.dist-info/LICENSE,sha256=Z1IBhHCzIeGR9F2iHtcLt2I2qoUhJ2pK139CAIAuFgo,1151
15
- python_documentcloud-4.3.0.dist-info/METADATA,sha256=IzRfB3f2kt523y3XT4ndU80eQrYmpEpbU2J3m3noYtY,2695
16
- python_documentcloud-4.3.0.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
17
- python_documentcloud-4.3.0.dist-info/top_level.txt,sha256=rzNW2vA9GqU5ipNQYSP1XJQ54ippjKXVIo9oMlM0Tm4,14
18
- python_documentcloud-4.3.0.dist-info/RECORD,,
14
+ python_documentcloud-4.4.0.dist-info/LICENSE,sha256=Z1IBhHCzIeGR9F2iHtcLt2I2qoUhJ2pK139CAIAuFgo,1151
15
+ python_documentcloud-4.4.0.dist-info/METADATA,sha256=j7wqTddQt4tj-iOttcd_hB8buI1HiEZ8AaxLwVjWn20,2858
16
+ python_documentcloud-4.4.0.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
17
+ python_documentcloud-4.4.0.dist-info/top_level.txt,sha256=rzNW2vA9GqU5ipNQYSP1XJQ54ippjKXVIo9oMlM0Tm4,14
18
+ python_documentcloud-4.4.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any