dubidoc 0.1.4__tar.gz → 0.2.0__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.
Files changed (26) hide show
  1. {dubidoc-0.1.4 → dubidoc-0.2.0}/PKG-INFO +3 -2
  2. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/__init__.py +1 -1
  3. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/__init__.py +1 -0
  4. dubidoc-0.2.0/dubidoc/_modules/organization.py +22 -0
  5. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/client.py +5 -2
  6. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/PKG-INFO +3 -2
  7. {dubidoc-0.1.4 → dubidoc-0.2.0}/pyproject.toml +1 -1
  8. dubidoc-0.1.4/dubidoc/_modules/organization.py +0 -1
  9. {dubidoc-0.1.4 → dubidoc-0.2.0}/LICENSE +0 -0
  10. {dubidoc-0.1.4 → dubidoc-0.2.0}/README.md +0 -0
  11. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/access_token.py +0 -0
  12. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/authentication.py +0 -0
  13. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/device.py +0 -0
  14. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/document.py +0 -0
  15. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/document_link.py +0 -0
  16. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/download.py +0 -0
  17. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/organization_user.py +0 -0
  18. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/participant.py +0 -0
  19. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/_modules/storecode.py +0 -0
  20. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/enum.py +0 -0
  21. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc/response.py +0 -0
  22. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/SOURCES.txt +0 -0
  23. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/dependency_links.txt +0 -0
  24. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/requires.txt +0 -0
  25. {dubidoc-0.1.4 → dubidoc-0.2.0}/dubidoc.egg-info/top_level.txt +0 -0
  26. {dubidoc-0.1.4 → dubidoc-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dubidoc
3
- Version: 0.1.4
3
+ Version: 0.2.0
4
4
  Summary: Python SDK for dubidoc.com.ua API
5
5
  Maintainer-email: Dmytro Litvinov <me@dmytrolitvinov.com>
6
6
  License: MIT License
@@ -26,6 +26,7 @@ Requires-Python: >=3.8
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: requests
29
+ Dynamic: license-file
29
30
 
30
31
  # Dubidoc API client ✍
31
32
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  __author__ = 'Dmytro Litvinov'
4
4
  __email__ = 'me@dmytrolitvinov.com'
5
- __version__ = '0.1.4'
5
+ __version__ = '0.2.0'
6
6
 
7
7
  from .client import DubidocAPIClient
@@ -4,4 +4,5 @@ from .device import *
4
4
  from .document import *
5
5
  from .document_link import *
6
6
  from .download import *
7
+ from .organization import *
7
8
  from .participant import *
@@ -0,0 +1,22 @@
1
+ from dubidoc.enum import HttpMethod
2
+
3
+
4
+ __all__ = ('OrganizationAPI',)
5
+
6
+
7
+ class OrganizationAPI:
8
+ PATH = 'organizations'
9
+
10
+ def __init__(self, client):
11
+ self.client = client
12
+
13
+ def list(self):
14
+ return self.client.make_request(HttpMethod.GET, self.PATH)
15
+
16
+ def get(self, document_id):
17
+ path = f'{self.PATH}/{document_id}'
18
+ return self.client.make_request(HttpMethod.GET, path)
19
+
20
+ def edit(self, document_id, body):
21
+ path = f'{self.PATH}/{document_id}'
22
+ return self.client.make_request(HttpMethod.PUT, path, body)
@@ -12,6 +12,7 @@ from dubidoc._modules import (
12
12
  DocumentLinkAPI,
13
13
  ParticipantAPI,
14
14
  DownloadAPI,
15
+ OrganizationAPI,
15
16
  )
16
17
  from dubidoc.enum import HttpMethod
17
18
  from dubidoc.response import DubidocAPIResponse
@@ -32,8 +33,9 @@ class DubidocAPIClient:
32
33
  'user-agent': f'python-dubidoc/{__version__} | (https://github.com/DmytroLitvinov/python-dubidoc)',
33
34
  }
34
35
 
35
- def __init__(self, api_token: str, *, is_stage_env: bool = False):
36
+ def __init__(self, api_token: str, organization_uuid: str = '', *, is_stage_env: bool = False):
36
37
  self.api_token = api_token
38
+ self.organization_uuid = organization_uuid
37
39
  if is_stage_env:
38
40
  self.base_url = 'https://docs-stage.navkolo.one'
39
41
  else:
@@ -50,6 +52,7 @@ class DubidocAPIClient:
50
52
  self.document_link_api = self._get_module(DocumentLinkAPI)
51
53
  self.participant_api = self._get_module(ParticipantAPI)
52
54
  self.download_api = self._get_module(DownloadAPI)
55
+ self.organization_api = self._get_module(OrganizationAPI)
53
56
 
54
57
  if is_stage_env == 'stage':
55
58
  self.access_token_api = self._get_module(AccessTokenAPI)
@@ -62,7 +65,7 @@ class DubidocAPIClient:
62
65
 
63
66
  def _get_headers(self):
64
67
  headers = self.DEFAULT_HEADERS.copy()
65
- headers.update({'X-Access-Token': f'{self.api_token}'})
68
+ headers.update({'X-Access-Token': f'{self.api_token}', 'X-Organization': self.organization_uuid})
66
69
  return headers
67
70
 
68
71
  def _get_module(self, cls):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dubidoc
3
- Version: 0.1.4
3
+ Version: 0.2.0
4
4
  Summary: Python SDK for dubidoc.com.ua API
5
5
  Maintainer-email: Dmytro Litvinov <me@dmytrolitvinov.com>
6
6
  License: MIT License
@@ -26,6 +26,7 @@ Requires-Python: >=3.8
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: requests
29
+ Dynamic: license-file
29
30
 
30
31
  # Dubidoc API client ✍
31
32
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dubidoc"
7
- version = "0.1.4"
7
+ version = "0.2.0"
8
8
  requires-python = ">=3.8"
9
9
  description = "Python SDK for dubidoc.com.ua API"
10
10
  readme = "README.md"
@@ -1 +0,0 @@
1
- # TODO
File without changes
File without changes
File without changes
File without changes
File without changes