truto-python-sdk 0.1.0__tar.gz → 0.1.2__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. truto_python_sdk-0.1.2/PKG-INFO +78 -0
  2. truto_python_sdk-0.1.2/README.md +63 -0
  3. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/pyproject.toml +3 -2
  4. truto_python_sdk-0.1.0/PKG-INFO +0 -16
  5. truto_python_sdk-0.1.0/README.md +0 -2
  6. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/LICENSE +0 -0
  7. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/__init__.py +0 -0
  8. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/base_resource.py +0 -0
  9. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/dict_to_query_string.py +0 -0
  10. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/environment.py +0 -0
  11. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/environment_integration.py +0 -0
  12. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/environment_unified_model.py +0 -0
  13. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/integrated_account.py +0 -0
  14. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/integration.py +0 -0
  15. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/link_token.py +0 -0
  16. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/pagination_result.py +0 -0
  17. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/proxy_api.py +0 -0
  18. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/sync_job.py +0 -0
  19. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/sync_job_cron_trigger.py +0 -0
  20. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/sync_job_run.py +0 -0
  21. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/team.py +0 -0
  22. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/truto_api.py +0 -0
  23. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/unified_api.py +0 -0
  24. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/unified_model.py +0 -0
  25. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/user.py +0 -0
  26. {truto_python_sdk-0.1.0 → truto_python_sdk-0.1.2}/truto_python_sdk/webhook.py +0 -0
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.3
2
+ Name: truto-python-sdk
3
+ Version: 0.1.2
4
+ Summary: Python3 SDK for the Truto API
5
+ Author: Roopendra Talekar
6
+ Author-email: roopendratalekar@gmail.com
7
+ Requires-Python: >=3.12,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Requires-Dist: aiohttp (==3.12.14)
12
+ Requires-Dist: asyncio (==3.4.3)
13
+ Project-URL: Repository, https://github.com/trutohq/truto-python-sdk
14
+ Description-Content-Type: text/markdown
15
+
16
+ # truto-python-sdk
17
+ Python3 SDK for the Truto API. The SDK mirrors the Truto REST API endpoints which are documented in the Truto Postman Collection.
18
+
19
+ [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
20
+
21
+ ## Installation
22
+ ```bash
23
+ pip install truto-python-sdk
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```python
29
+ import asyncio
30
+ from truto_python_sdk import TrutoApi
31
+
32
+ # Initialize the SDK with your token
33
+ truto_api = TrutoApi(token="<your_api_token>")
34
+
35
+ async def main():
36
+ async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
37
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
38
+ }):
39
+ print(await truto_api.proxy_api.get("ticketing-tickets", ticket["id"], {
40
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
41
+ }))
42
+
43
+ # Run the async function
44
+ asyncio.run(main())
45
+ ```
46
+
47
+ ## List calls and pagination
48
+
49
+ The SDK uses async generators to handle list calls. This allows you to iterate over the results of a list call without having to worry about pagination. The SDK will automatically fetch the next page of results when needed.
50
+
51
+ ```python
52
+ async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
53
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
54
+ }):
55
+ print(ticket)
56
+ ```
57
+
58
+ You can also call `to_array()`, which will auto-paginate all the resources and return them as a list.
59
+
60
+ ```python
61
+ tickets = await truto_api.unified_api.list("ticketing", "tickets", {
62
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
63
+ }).to_array()
64
+ ```
65
+
66
+ Getting each page of results manually is also possible.
67
+
68
+ ```python
69
+ page = await truto_api.unified_api.list("ticketing", "tickets", {
70
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
71
+ }).next_page()
72
+ ```
73
+
74
+ ## Contributing
75
+ We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
76
+
77
+ ## License
78
+ MIT
@@ -0,0 +1,63 @@
1
+ # truto-python-sdk
2
+ Python3 SDK for the Truto API. The SDK mirrors the Truto REST API endpoints which are documented in the Truto Postman Collection.
3
+
4
+ [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/25523816-b3550004-776b-4372-be86-562791b192ce?action=collection%2Ffork&collection-url=entityId%3D25523816-b3550004-776b-4372-be86-562791b192ce%26entityType%3Dcollection%26workspaceId%3D7cc4fe33-eb97-4dc7-98b5-2a7ff2e94e67)
5
+
6
+ ## Installation
7
+ ```bash
8
+ pip install truto-python-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ import asyncio
15
+ from truto_python_sdk import TrutoApi
16
+
17
+ # Initialize the SDK with your token
18
+ truto_api = TrutoApi(token="<your_api_token>")
19
+
20
+ async def main():
21
+ async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
22
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
23
+ }):
24
+ print(await truto_api.proxy_api.get("ticketing-tickets", ticket["id"], {
25
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
26
+ }))
27
+
28
+ # Run the async function
29
+ asyncio.run(main())
30
+ ```
31
+
32
+ ## List calls and pagination
33
+
34
+ The SDK uses async generators to handle list calls. This allows you to iterate over the results of a list call without having to worry about pagination. The SDK will automatically fetch the next page of results when needed.
35
+
36
+ ```python
37
+ async for ticket in truto_api.unified_api.list("ticketing", "tickets", {
38
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
39
+ }):
40
+ print(ticket)
41
+ ```
42
+
43
+ You can also call `to_array()`, which will auto-paginate all the resources and return them as a list.
44
+
45
+ ```python
46
+ tickets = await truto_api.unified_api.list("ticketing", "tickets", {
47
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
48
+ }).to_array()
49
+ ```
50
+
51
+ Getting each page of results manually is also possible.
52
+
53
+ ```python
54
+ page = await truto_api.unified_api.list("ticketing", "tickets", {
55
+ "integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"
56
+ }).next_page()
57
+ ```
58
+
59
+ ## Contributing
60
+ We welcome contributions to improve `truto-python-sdk`. Please submit issues or pull requests on the GitHub repository.
61
+
62
+ ## License
63
+ MIT
@@ -1,13 +1,14 @@
1
1
  [tool.poetry]
2
2
  name = "truto-python-sdk"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Python3 SDK for the Truto API"
5
5
  authors = ["Roopendra Talekar <roopendratalekar@gmail.com>"]
6
6
  readme = "README.md"
7
+ repository = "https://github.com/trutohq/truto-python-sdk"
7
8
 
8
9
  [tool.poetry.dependencies]
9
10
  python = "^3.12"
10
- aiohttp = "3.10.5"
11
+ aiohttp = "3.12.14"
11
12
  asyncio = "3.4.3"
12
13
 
13
14
 
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: truto-python-sdk
3
- Version: 0.1.0
4
- Summary: Python3 SDK for the Truto API
5
- Author: Roopendra Talekar
6
- Author-email: roopendratalekar@gmail.com
7
- Requires-Python: >=3.12,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.12
10
- Requires-Dist: aiohttp (==3.10.5)
11
- Requires-Dist: asyncio (==3.4.3)
12
- Description-Content-Type: text/markdown
13
-
14
- # truto-python-sdk
15
- Python3 SDK for the Truto API
16
-
@@ -1,2 +0,0 @@
1
- # truto-python-sdk
2
- Python3 SDK for the Truto API