pipedream 0.3.0__tar.gz → 0.3.1__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 (137) hide show
  1. pipedream-0.3.1/LICENSE +123 -0
  2. pipedream-0.3.1/PKG-INFO +221 -0
  3. pipedream-0.3.1/README.md +194 -0
  4. pipedream-0.3.1/pyproject.toml +84 -0
  5. pipedream-0.3.1/src/pipedream/__init__.py +157 -0
  6. pipedream-0.3.1/src/pipedream/accounts/__init__.py +4 -0
  7. pipedream-0.3.1/src/pipedream/accounts/client.py +573 -0
  8. pipedream-0.3.1/src/pipedream/accounts/raw_client.py +568 -0
  9. pipedream-0.3.1/src/pipedream/actions/__init__.py +4 -0
  10. pipedream-0.3.1/src/pipedream/actions/client.py +710 -0
  11. pipedream-0.3.1/src/pipedream/actions/raw_client.py +744 -0
  12. pipedream-0.3.1/src/pipedream/app_categories/__init__.py +4 -0
  13. pipedream-0.3.1/src/pipedream/app_categories/client.py +177 -0
  14. pipedream-0.3.1/src/pipedream/app_categories/raw_client.py +165 -0
  15. pipedream-0.3.1/src/pipedream/apps/__init__.py +7 -0
  16. pipedream-0.3.1/src/pipedream/apps/client.py +269 -0
  17. pipedream-0.3.1/src/pipedream/apps/raw_client.py +286 -0
  18. pipedream-0.3.1/src/pipedream/apps/types/__init__.py +8 -0
  19. pipedream-0.3.1/src/pipedream/apps/types/apps_list_request_sort_direction.py +5 -0
  20. pipedream-0.3.1/src/pipedream/apps/types/apps_list_request_sort_key.py +5 -0
  21. pipedream-0.3.1/src/pipedream/client.py +247 -0
  22. pipedream-0.3.1/src/pipedream/components/__init__.py +4 -0
  23. pipedream-0.3.1/src/pipedream/components/client.py +581 -0
  24. pipedream-0.3.1/src/pipedream/components/raw_client.py +611 -0
  25. pipedream-0.3.1/src/pipedream/core/__init__.py +55 -0
  26. pipedream-0.3.1/src/pipedream/core/api_error.py +23 -0
  27. pipedream-0.3.1/src/pipedream/core/client_wrapper.py +111 -0
  28. pipedream-0.3.1/src/pipedream/core/datetime_utils.py +28 -0
  29. pipedream-0.3.1/src/pipedream/core/file.py +67 -0
  30. pipedream-0.3.1/src/pipedream/core/force_multipart.py +16 -0
  31. pipedream-0.3.1/src/pipedream/core/http_client.py +543 -0
  32. pipedream-0.3.1/src/pipedream/core/http_response.py +55 -0
  33. pipedream-0.3.1/src/pipedream/core/jsonable_encoder.py +100 -0
  34. pipedream-0.3.1/src/pipedream/core/oauth_token_provider.py +34 -0
  35. pipedream-0.3.1/src/pipedream/core/pagination.py +82 -0
  36. pipedream-0.3.1/src/pipedream/core/pydantic_utilities.py +255 -0
  37. pipedream-0.3.1/src/pipedream/core/query_encoder.py +58 -0
  38. pipedream-0.3.1/src/pipedream/core/remove_none_from_dict.py +11 -0
  39. pipedream-0.3.1/src/pipedream/core/request_options.py +35 -0
  40. pipedream-0.3.1/src/pipedream/core/serialization.py +276 -0
  41. pipedream-0.3.1/src/pipedream/deployed_triggers/__init__.py +4 -0
  42. pipedream-0.3.1/src/pipedream/deployed_triggers/client.py +968 -0
  43. pipedream-0.3.1/src/pipedream/deployed_triggers/raw_client.py +989 -0
  44. pipedream-0.3.1/src/pipedream/environment.py +9 -0
  45. pipedream-0.3.1/src/pipedream/oauth_tokens/__init__.py +4 -0
  46. pipedream-0.3.1/src/pipedream/oauth_tokens/client.py +127 -0
  47. pipedream-0.3.1/src/pipedream/oauth_tokens/raw_client.py +118 -0
  48. pipedream-0.3.1/src/pipedream/pipedream.py +80 -0
  49. pipedream-0.3.1/src/pipedream/projects/__init__.py +4 -0
  50. pipedream-0.3.1/src/pipedream/projects/client.py +102 -0
  51. pipedream-0.3.1/src/pipedream/projects/raw_client.py +90 -0
  52. pipedream-0.3.1/src/pipedream/proxy/__init__.py +4 -0
  53. pipedream-0.3.1/src/pipedream/proxy/client.py +620 -0
  54. pipedream-0.3.1/src/pipedream/proxy/raw_client.py +592 -0
  55. pipedream-0.3.1/src/pipedream/py.typed +0 -0
  56. pipedream-0.3.1/src/pipedream/tokens/__init__.py +4 -0
  57. pipedream-0.3.1/src/pipedream/tokens/client.py +271 -0
  58. pipedream-0.3.1/src/pipedream/tokens/raw_client.py +266 -0
  59. pipedream-0.3.1/src/pipedream/triggers/__init__.py +4 -0
  60. pipedream-0.3.1/src/pipedream/triggers/client.py +712 -0
  61. pipedream-0.3.1/src/pipedream/triggers/raw_client.py +749 -0
  62. pipedream-0.3.1/src/pipedream/types/__init__.py +119 -0
  63. pipedream-0.3.1/src/pipedream/types/account.py +84 -0
  64. pipedream-0.3.1/src/pipedream/types/app.py +67 -0
  65. pipedream-0.3.1/src/pipedream/types/app_auth_type.py +5 -0
  66. pipedream-0.3.1/src/pipedream/types/app_category.py +36 -0
  67. pipedream-0.3.1/src/pipedream/types/backend_client_opts.py +36 -0
  68. pipedream-0.3.1/src/pipedream/types/client_opts.py +36 -0
  69. pipedream-0.3.1/src/pipedream/types/component.py +50 -0
  70. pipedream-0.3.1/src/pipedream/types/component_stash.py +5 -0
  71. pipedream-0.3.1/src/pipedream/types/configurable_prop.py +82 -0
  72. pipedream-0.3.1/src/pipedream/types/configurable_prop_alert.py +91 -0
  73. pipedream-0.3.1/src/pipedream/types/configurable_prop_alert_alert_type.py +5 -0
  74. pipedream-0.3.1/src/pipedream/types/configurable_prop_any.py +78 -0
  75. pipedream-0.3.1/src/pipedream/types/configurable_prop_app.py +83 -0
  76. pipedream-0.3.1/src/pipedream/types/configurable_prop_boolean.py +78 -0
  77. pipedream-0.3.1/src/pipedream/types/configurable_prop_discord.py +78 -0
  78. pipedream-0.3.1/src/pipedream/types/configurable_prop_integer.py +88 -0
  79. pipedream-0.3.1/src/pipedream/types/configurable_prop_object.py +78 -0
  80. pipedream-0.3.1/src/pipedream/types/configurable_prop_string.py +83 -0
  81. pipedream-0.3.1/src/pipedream/types/configurable_prop_string_array.py +83 -0
  82. pipedream-0.3.1/src/pipedream/types/configure_prop_opts.py +71 -0
  83. pipedream-0.3.1/src/pipedream/types/configure_prop_response.py +32 -0
  84. pipedream-0.3.1/src/pipedream/types/connect_token_create_opts.py +51 -0
  85. pipedream-0.3.1/src/pipedream/types/connect_token_response.py +37 -0
  86. pipedream-0.3.1/src/pipedream/types/create_browser_client_opts.py +26 -0
  87. pipedream-0.3.1/src/pipedream/types/create_o_auth_token_response.py +25 -0
  88. pipedream-0.3.1/src/pipedream/types/create_token_response.py +37 -0
  89. pipedream-0.3.1/src/pipedream/types/delete_trigger_opts.py +26 -0
  90. pipedream-0.3.1/src/pipedream/types/deploy_trigger_response.py +24 -0
  91. pipedream-0.3.1/src/pipedream/types/deployed_component.py +74 -0
  92. pipedream-0.3.1/src/pipedream/types/emitted_event.py +41 -0
  93. pipedream-0.3.1/src/pipedream/types/error_response.py +36 -0
  94. pipedream-0.3.1/src/pipedream/types/get_accounts_response.py +26 -0
  95. pipedream-0.3.1/src/pipedream/types/get_app_category_response.py +5 -0
  96. pipedream-0.3.1/src/pipedream/types/get_app_response.py +24 -0
  97. pipedream-0.3.1/src/pipedream/types/get_apps_response.py +26 -0
  98. pipedream-0.3.1/src/pipedream/types/get_component_response.py +24 -0
  99. pipedream-0.3.1/src/pipedream/types/get_components_response.py +26 -0
  100. pipedream-0.3.1/src/pipedream/types/get_trigger_events_response.py +24 -0
  101. pipedream-0.3.1/src/pipedream/types/get_trigger_response.py +24 -0
  102. pipedream-0.3.1/src/pipedream/types/get_trigger_webhooks_response.py +23 -0
  103. pipedream-0.3.1/src/pipedream/types/get_trigger_workflows_response.py +23 -0
  104. pipedream-0.3.1/src/pipedream/types/get_triggers_response.py +26 -0
  105. pipedream-0.3.1/src/pipedream/types/list_accounts_response.py +26 -0
  106. pipedream-0.3.1/src/pipedream/types/list_app_categories_response.py +7 -0
  107. pipedream-0.3.1/src/pipedream/types/list_apps_response.py +26 -0
  108. pipedream-0.3.1/src/pipedream/types/page_info.py +22 -0
  109. pipedream-0.3.1/src/pipedream/types/project_info_response.py +24 -0
  110. pipedream-0.3.1/src/pipedream/types/project_info_response_apps_item.py +27 -0
  111. pipedream-0.3.1/src/pipedream/types/prop_option.py +28 -0
  112. pipedream-0.3.1/src/pipedream/types/proxy_response.py +33 -0
  113. pipedream-0.3.1/src/pipedream/types/reload_props_opts.py +51 -0
  114. pipedream-0.3.1/src/pipedream/types/reload_props_response.py +27 -0
  115. pipedream-0.3.1/src/pipedream/types/run_action_response.py +29 -0
  116. pipedream-0.3.1/src/pipedream/types/start_connect_opts.py +26 -0
  117. pipedream-0.3.1/src/pipedream/types/validate_token_params.py +31 -0
  118. pipedream-0.3.1/src/pipedream/types/validate_token_response.py +68 -0
  119. pipedream-0.3.1/src/pipedream/users/__init__.py +4 -0
  120. pipedream-0.3.1/src/pipedream/users/client.py +111 -0
  121. pipedream-0.3.1/src/pipedream/users/raw_client.py +76 -0
  122. pipedream-0.3.1/src/pipedream/version.py +3 -0
  123. pipedream-0.3.0/LICENSE +0 -21
  124. pipedream-0.3.0/LICENSE-MIT +0 -21
  125. pipedream-0.3.0/MANIFEST.in +0 -4
  126. pipedream-0.3.0/PKG-INFO +0 -44
  127. pipedream-0.3.0/README.md +0 -10
  128. pipedream-0.3.0/README.rst +0 -22
  129. pipedream-0.3.0/pipedream/__init__.py +0 -1
  130. pipedream-0.3.0/pipedream/script_helpers.py +0 -15
  131. pipedream-0.3.0/pipedream.egg-info/PKG-INFO +0 -44
  132. pipedream-0.3.0/pipedream.egg-info/SOURCES.txt +0 -13
  133. pipedream-0.3.0/pipedream.egg-info/dependency_links.txt +0 -1
  134. pipedream-0.3.0/pipedream.egg-info/top_level.txt +0 -1
  135. pipedream-0.3.0/pyproject.toml +0 -17
  136. pipedream-0.3.0/setup.cfg +0 -4
  137. pipedream-0.3.0/setup.py +0 -57
@@ -0,0 +1,123 @@
1
+ Pipedream Source Available License Version 1.0
2
+
3
+ This Pipedream Source Available License Agreement Version 1.0 (this
4
+ “Agreement”) sets forth the terms on which Pipedream, Inc., a Delaware
5
+ corporation (“Pipedream”) makes available certain software (the
6
+ “Software”). By installing, downloading, accessing, using or
7
+ distributing the Software, you agree to the terms of this
8
+ Agreement. If you do not agree to such terms, you must not use the
9
+ Software. If you are receiving the Software on behalf of a legal
10
+ entity, you represent and warrant that you have the actual authority
11
+ to agree to the terms and conditions of this Agreement on behalf of
12
+ such entity. “Licensee” means you, an individual, or the entity on
13
+ whose behalf you are receiving the Software.
14
+
15
+ LICENSE GRANT AND CONDITIONS.
16
+
17
+ 1.1 License. Subject to the terms and conditions of this Agreement,
18
+ Pipedream hereby grants to Licensee a non-exclusive, royalty-free,
19
+ worldwide, non-transferable, non-sublicenseable license during the
20
+ term of this Agreement to use, prepare modifications and derivative
21
+ works, distribute (including without limitation in source code or
22
+ object code form) and reproduce copies of the Software (the
23
+ “License”). Licensee is not granted the right to, and Licensee shall
24
+ not, exercise the License for an Excluded Purpose. For purposes of
25
+ this Agreement, “Excluded Purpose” means any commercial use of the
26
+ software including, but not limited to, making available any
27
+ software-as-a-service, platform-as-a-service,
28
+ infrastructure-as-a-service or other online service that competes with
29
+ the Software or any other Pipedream products or services.
30
+
31
+ 1.2 Conditions. In consideration of the License, Licensee’s
32
+ distribution of the Software is subject to the following conditions:
33
+
34
+ a. Licensee must cause any Software modified by Licensee to carry
35
+ prominent notices stating that Licensee modified the Software.
36
+
37
+ b. On each Software copy, Licensee shall reproduce and not remove or
38
+ alter all Pipedream or third party copyright or other proprietary
39
+ notices contained in the Software, and Licensee must provide this with
40
+ each copy: “This software is made available by Pipedream, Inc., under
41
+ the terms of the Pipedream Source Available License, Version 1.0
42
+ located at
43
+ https://github.com/PipedreamHQ/pipedream/blob/master/LICENSE. By
44
+ installing, downloading, accessing, using or distributing the
45
+ Software, you agree to the terms of such License Agreement.”
46
+
47
+ 1.3 Modifications. Licensee may add its own copyright notices to
48
+ modifications made by Licensee and may provide additional or different
49
+ license terms and conditions for use, reproduction, or distribution of
50
+ Licensee’s modifications. While redistributing the Software or
51
+ modifications thereof, Licensee may choose to offer, for a fee or free
52
+ of charge, support, warranty, indemnity, or other
53
+ obligations. Licensee, and not Pipedream, will be responsible for any
54
+ such obligations.
55
+
56
+ 1.4 No Sublicensing. The License does not include the right to
57
+ sublicense the Software; provided, however, that any recipient to
58
+ which Licensee provides the Software may exercise the License so long
59
+ as such recipient agrees to the terms and conditions of this
60
+ Agreement.
61
+
62
+ TERM AND TERMINATION.
63
+
64
+ This Agreement will continue unless and until earlier terminated as
65
+ set forth herein. If Licensee breaches any of its conditions or
66
+ obligations under this Agreement, this Agreement will terminate
67
+ automatically and the License will terminate automatically and
68
+ permanently.
69
+
70
+ INTELLECTUAL PROPERTY.
71
+
72
+ As between the parties, Pipedream retains all right, title, and
73
+ interest in the Software, and all intellectual property rights
74
+ therein. Pipedream hereby reserves all rights not expressly granted to
75
+ Licensee in this Agreement. Pipedream reserves all rights in its
76
+ trademarks and service marks, and no licenses thereto are granted by
77
+ this Agreement.
78
+
79
+ DISCLAIMER.
80
+
81
+ PIPEDREAM HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS,
82
+ EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS
83
+ ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
84
+ WITH RESPECT TO THE SOFTWARE.
85
+
86
+ LIMITATION OF LIABILITY.
87
+
88
+ PIPEDREAM WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING
89
+ BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL,
90
+ INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY
91
+ THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING
92
+ SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
93
+
94
+ GENERAL.
95
+
96
+ 6.1 Governing Law. This Agreement will be governed by and interpreted
97
+ in accordance with the laws of the state of California, without
98
+ reference to its conflict of laws principles. If Licensee is located
99
+ outside of the United States, any dispute, controversy or claim
100
+ arising out of or relating to this Agreement will be referred to and
101
+ finally determined by arbitration in accordance with the JAMS
102
+ International Arbitration Rules. The tribunal will consist of one
103
+ arbitrator. Judgment upon the award rendered by the arbitrator may be
104
+ entered in any court having jurisdiction thereof. All disputes
105
+ including arbitrations shall take place in Santa Clara County,
106
+ California. The language to be used in any such proceedings shall be
107
+ English.
108
+
109
+ 6.2. Assignment. Licensee is not authorized to assign its rights
110
+ under this Agreement to any third party. Pipedream may freely assign
111
+ its rights under this Agreement to any third party.
112
+
113
+ 6.3. Other. This Agreement is the entire agreement between the
114
+ parties regarding the subject matter hereof. No amendment or
115
+ modification of this Agreement will be valid or binding upon the
116
+ parties unless made in writing and signed by the duly authorized
117
+ representatives of both parties. In the event that any provision,
118
+ including without limitation any condition, of this Agreement is held
119
+ to be unenforceable, this Agreement and all licenses and rights
120
+ granted hereunder will immediately terminate. Waiver by Pipedream of a
121
+ breach of any provision of this Agreement or the failure by Pipedream
122
+ to exercise any right hereunder will not be construed as a waiver of
123
+ any subsequent breach of that right or as a waiver of any other right.
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.1
2
+ Name: pipedream
3
+ Version: 0.3.1
4
+ Summary:
5
+ Requires-Python: >=3.8,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: httpx (>=0.21.2)
22
+ Requires-Dist: pydantic (>=1.9.2)
23
+ Requires-Dist: pydantic-core (>=2.18.2)
24
+ Requires-Dist: typing_extensions (>=4.0.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Pipedream Python Library
28
+
29
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPipedreamHQ%2Fpipedream-sdk-python)
30
+ [![pypi](https://img.shields.io/pypi/v/pipedream)](https://pypi.python.org/pypi/pipedream)
31
+
32
+ The Pipedream Python library provides convenient access to the Pipedream API from Python.
33
+
34
+ ## Installation
35
+
36
+ ```sh
37
+ pip install pipedream
38
+ ```
39
+
40
+ ## Reference
41
+
42
+ A full reference for this library is available [here](https://github.com/PipedreamHQ/pipedream-sdk-python/blob/HEAD/./reference.md).
43
+
44
+ ## Usage
45
+
46
+ Instantiate and use the client with the following:
47
+
48
+ ```python
49
+ from pipedream import Pipedream
50
+
51
+ client = Pipedream(
52
+ project_id="YOUR_PROJECT_ID",
53
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
54
+ client_id="YOUR_CLIENT_ID",
55
+ client_secret="YOUR_CLIENT_SECRET",
56
+ )
57
+ client.accounts.create(
58
+ app_slug="app_slug",
59
+ cfmap_json="cfmap_json",
60
+ connect_token="connect_token",
61
+ )
62
+ ```
63
+
64
+ ## Async Client
65
+
66
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
67
+
68
+ ```python
69
+ import asyncio
70
+
71
+ from pipedream import AsyncPipedream
72
+
73
+ client = AsyncPipedream(
74
+ project_id="YOUR_PROJECT_ID",
75
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
76
+ client_id="YOUR_CLIENT_ID",
77
+ client_secret="YOUR_CLIENT_SECRET",
78
+ )
79
+
80
+
81
+ async def main() -> None:
82
+ await client.accounts.create(
83
+ app_slug="app_slug",
84
+ cfmap_json="cfmap_json",
85
+ connect_token="connect_token",
86
+ )
87
+
88
+
89
+ asyncio.run(main())
90
+ ```
91
+
92
+ ## Exception Handling
93
+
94
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
95
+ will be thrown.
96
+
97
+ ```python
98
+ from pipedream.core.api_error import ApiError
99
+
100
+ try:
101
+ client.accounts.create(...)
102
+ except ApiError as e:
103
+ print(e.status_code)
104
+ print(e.body)
105
+ ```
106
+
107
+ ## Pagination
108
+
109
+ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
110
+
111
+ ```python
112
+ from pipedream import Pipedream
113
+
114
+ client = Pipedream(
115
+ project_id="YOUR_PROJECT_ID",
116
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
117
+ client_id="YOUR_CLIENT_ID",
118
+ client_secret="YOUR_CLIENT_SECRET",
119
+ )
120
+ response = client.apps.list()
121
+ for item in response:
122
+ yield item
123
+ # alternatively, you can paginate page-by-page
124
+ for page in response.iter_pages():
125
+ yield page
126
+ ```
127
+
128
+ ## Advanced
129
+
130
+ ### Access Raw Response Data
131
+
132
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
133
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
134
+
135
+ ```python
136
+ from pipedream import Pipedream
137
+
138
+ client = Pipedream(
139
+ ...,
140
+ )
141
+ response = client.accounts.with_raw_response.create(...)
142
+ print(response.headers) # access the response headers
143
+ print(response.data) # access the underlying object
144
+ pager = client.apps.list(...)
145
+ print(pager.response.headers) # access the response headers for the first page
146
+ for item in pager:
147
+ print(item) # access the underlying object(s)
148
+ for page in pager.iter_pages():
149
+ print(page.response.headers) # access the response headers for each page
150
+ for item in page:
151
+ print(item) # access the underlying object(s)
152
+ ```
153
+
154
+ ### Retries
155
+
156
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
157
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
158
+ retry limit (default: 2).
159
+
160
+ A request is deemed retryable when any of the following HTTP status codes is returned:
161
+
162
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
163
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
164
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
165
+
166
+ Use the `max_retries` request option to configure this behavior.
167
+
168
+ ```python
169
+ client.accounts.create(..., request_options={
170
+ "max_retries": 1
171
+ })
172
+ ```
173
+
174
+ ### Timeouts
175
+
176
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
177
+
178
+ ```python
179
+
180
+ from pipedream import Pipedream
181
+
182
+ client = Pipedream(
183
+ ...,
184
+ timeout=20.0,
185
+ )
186
+
187
+
188
+ # Override timeout for a specific method
189
+ client.accounts.create(..., request_options={
190
+ "timeout_in_seconds": 1
191
+ })
192
+ ```
193
+
194
+ ### Custom Client
195
+
196
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
197
+ and transports.
198
+
199
+ ```python
200
+ import httpx
201
+ from pipedream import Pipedream
202
+
203
+ client = Pipedream(
204
+ ...,
205
+ httpx_client=httpx.Client(
206
+ proxies="http://my.test.proxy.example.com",
207
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
208
+ ),
209
+ )
210
+ ```
211
+
212
+ ## Contributing
213
+
214
+ While we value open-source contributions to this SDK, this library is generated programmatically.
215
+ Additions made directly to this library would have to be moved over to our generation code,
216
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
217
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
218
+ an issue first to discuss with us!
219
+
220
+ On the other hand, contributions to the README are always very welcome!
221
+
@@ -0,0 +1,194 @@
1
+ # Pipedream Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPipedreamHQ%2Fpipedream-sdk-python)
4
+ [![pypi](https://img.shields.io/pypi/v/pipedream)](https://pypi.python.org/pypi/pipedream)
5
+
6
+ The Pipedream Python library provides convenient access to the Pipedream API from Python.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ pip install pipedream
12
+ ```
13
+
14
+ ## Reference
15
+
16
+ A full reference for this library is available [here](https://github.com/PipedreamHQ/pipedream-sdk-python/blob/HEAD/./reference.md).
17
+
18
+ ## Usage
19
+
20
+ Instantiate and use the client with the following:
21
+
22
+ ```python
23
+ from pipedream import Pipedream
24
+
25
+ client = Pipedream(
26
+ project_id="YOUR_PROJECT_ID",
27
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
28
+ client_id="YOUR_CLIENT_ID",
29
+ client_secret="YOUR_CLIENT_SECRET",
30
+ )
31
+ client.accounts.create(
32
+ app_slug="app_slug",
33
+ cfmap_json="cfmap_json",
34
+ connect_token="connect_token",
35
+ )
36
+ ```
37
+
38
+ ## Async Client
39
+
40
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
41
+
42
+ ```python
43
+ import asyncio
44
+
45
+ from pipedream import AsyncPipedream
46
+
47
+ client = AsyncPipedream(
48
+ project_id="YOUR_PROJECT_ID",
49
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
50
+ client_id="YOUR_CLIENT_ID",
51
+ client_secret="YOUR_CLIENT_SECRET",
52
+ )
53
+
54
+
55
+ async def main() -> None:
56
+ await client.accounts.create(
57
+ app_slug="app_slug",
58
+ cfmap_json="cfmap_json",
59
+ connect_token="connect_token",
60
+ )
61
+
62
+
63
+ asyncio.run(main())
64
+ ```
65
+
66
+ ## Exception Handling
67
+
68
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
69
+ will be thrown.
70
+
71
+ ```python
72
+ from pipedream.core.api_error import ApiError
73
+
74
+ try:
75
+ client.accounts.create(...)
76
+ except ApiError as e:
77
+ print(e.status_code)
78
+ print(e.body)
79
+ ```
80
+
81
+ ## Pagination
82
+
83
+ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
84
+
85
+ ```python
86
+ from pipedream import Pipedream
87
+
88
+ client = Pipedream(
89
+ project_id="YOUR_PROJECT_ID",
90
+ x_pd_environment="YOUR_X_PD_ENVIRONMENT",
91
+ client_id="YOUR_CLIENT_ID",
92
+ client_secret="YOUR_CLIENT_SECRET",
93
+ )
94
+ response = client.apps.list()
95
+ for item in response:
96
+ yield item
97
+ # alternatively, you can paginate page-by-page
98
+ for page in response.iter_pages():
99
+ yield page
100
+ ```
101
+
102
+ ## Advanced
103
+
104
+ ### Access Raw Response Data
105
+
106
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
107
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
108
+
109
+ ```python
110
+ from pipedream import Pipedream
111
+
112
+ client = Pipedream(
113
+ ...,
114
+ )
115
+ response = client.accounts.with_raw_response.create(...)
116
+ print(response.headers) # access the response headers
117
+ print(response.data) # access the underlying object
118
+ pager = client.apps.list(...)
119
+ print(pager.response.headers) # access the response headers for the first page
120
+ for item in pager:
121
+ print(item) # access the underlying object(s)
122
+ for page in pager.iter_pages():
123
+ print(page.response.headers) # access the response headers for each page
124
+ for item in page:
125
+ print(item) # access the underlying object(s)
126
+ ```
127
+
128
+ ### Retries
129
+
130
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
131
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
132
+ retry limit (default: 2).
133
+
134
+ A request is deemed retryable when any of the following HTTP status codes is returned:
135
+
136
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
137
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
138
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
139
+
140
+ Use the `max_retries` request option to configure this behavior.
141
+
142
+ ```python
143
+ client.accounts.create(..., request_options={
144
+ "max_retries": 1
145
+ })
146
+ ```
147
+
148
+ ### Timeouts
149
+
150
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
151
+
152
+ ```python
153
+
154
+ from pipedream import Pipedream
155
+
156
+ client = Pipedream(
157
+ ...,
158
+ timeout=20.0,
159
+ )
160
+
161
+
162
+ # Override timeout for a specific method
163
+ client.accounts.create(..., request_options={
164
+ "timeout_in_seconds": 1
165
+ })
166
+ ```
167
+
168
+ ### Custom Client
169
+
170
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
171
+ and transports.
172
+
173
+ ```python
174
+ import httpx
175
+ from pipedream import Pipedream
176
+
177
+ client = Pipedream(
178
+ ...,
179
+ httpx_client=httpx.Client(
180
+ proxies="http://my.test.proxy.example.com",
181
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
182
+ ),
183
+ )
184
+ ```
185
+
186
+ ## Contributing
187
+
188
+ While we value open-source contributions to this SDK, this library is generated programmatically.
189
+ Additions made directly to this library would have to be moved over to our generation code,
190
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
191
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
192
+ an issue first to discuss with us!
193
+
194
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,84 @@
1
+ [project]
2
+ name = "pipedream"
3
+
4
+ [tool.poetry]
5
+ name = "pipedream"
6
+ version = "0.3.1"
7
+ description = ""
8
+ readme = "README.md"
9
+ authors = []
10
+ keywords = []
11
+
12
+ classifiers = [
13
+ "Intended Audience :: Developers",
14
+ "Programming Language :: Python",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.8",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Operating System :: OS Independent",
22
+ "Operating System :: POSIX",
23
+ "Operating System :: MacOS",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Operating System :: Microsoft :: Windows",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ "Typing :: Typed"
28
+ ]
29
+ packages = [
30
+ { include = "pipedream", from = "src"}
31
+ ]
32
+
33
+ [project.urls]
34
+ Repository = 'https://github.com/PipedreamHQ/pipedream-sdk-python'
35
+
36
+ [tool.poetry.dependencies]
37
+ python = "^3.8"
38
+ httpx = ">=0.21.2"
39
+ pydantic = ">= 1.9.2"
40
+ pydantic-core = ">=2.18.2"
41
+ typing_extensions = ">= 4.0.0"
42
+
43
+ [tool.poetry.group.dev.dependencies]
44
+ mypy = "==1.13.0"
45
+ pytest = "^7.4.0"
46
+ pytest-asyncio = "^0.23.5"
47
+ python-dateutil = "^2.9.0"
48
+ types-python-dateutil = "^2.9.0.20240316"
49
+ ruff = "==0.11.5"
50
+
51
+ [tool.pytest.ini_options]
52
+ testpaths = [ "tests" ]
53
+ asyncio_mode = "auto"
54
+
55
+ [tool.mypy]
56
+ plugins = ["pydantic.mypy"]
57
+
58
+ [tool.ruff]
59
+ line-length = 120
60
+
61
+ [tool.ruff.lint]
62
+ select = [
63
+ "E", # pycodestyle errors
64
+ "F", # pyflakes
65
+ "I", # isort
66
+ ]
67
+ ignore = [
68
+ "E402", # Module level import not at top of file
69
+ "E501", # Line too long
70
+ "E711", # Comparison to `None` should be `cond is not None`
71
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
72
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
73
+ "E722", # Do not use bare `except`
74
+ "E731", # Do not assign a `lambda` expression, use a `def`
75
+ "F821", # Undefined name
76
+ "F841" # Local variable ... is assigned to but never used
77
+ ]
78
+
79
+ [tool.ruff.lint.isort]
80
+ section-order = ["future", "standard-library", "third-party", "first-party"]
81
+
82
+ [build-system]
83
+ requires = ["poetry-core"]
84
+ build-backend = "poetry.core.masonry.api"