prism-py-sdk 1.0.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 (98) hide show
  1. prism_py_sdk-1.0.1/LICENSE +21 -0
  2. prism_py_sdk-1.0.1/PKG-INFO +234 -0
  3. prism_py_sdk-1.0.1/README.md +202 -0
  4. prism_py_sdk-1.0.1/pyproject.toml +96 -0
  5. prism_py_sdk-1.0.1/src/prism_py_sdk/__init__.py +214 -0
  6. prism_py_sdk-1.0.1/src/prism_py_sdk/_default_clients.py +32 -0
  7. prism_py_sdk-1.0.1/src/prism_py_sdk/client.py +200 -0
  8. prism_py_sdk-1.0.1/src/prism_py_sdk/core/__init__.py +127 -0
  9. prism_py_sdk-1.0.1/src/prism_py_sdk/core/api_error.py +23 -0
  10. prism_py_sdk-1.0.1/src/prism_py_sdk/core/client_wrapper.py +100 -0
  11. prism_py_sdk-1.0.1/src/prism_py_sdk/core/datetime_utils.py +70 -0
  12. prism_py_sdk-1.0.1/src/prism_py_sdk/core/file.py +67 -0
  13. prism_py_sdk-1.0.1/src/prism_py_sdk/core/force_multipart.py +18 -0
  14. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_client.py +839 -0
  15. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_response.py +59 -0
  16. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_sse/__init__.py +42 -0
  17. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_sse/_api.py +148 -0
  18. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_sse/_decoders.py +61 -0
  19. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_sse/_exceptions.py +7 -0
  20. prism_py_sdk-1.0.1/src/prism_py_sdk/core/http_sse/_models.py +17 -0
  21. prism_py_sdk-1.0.1/src/prism_py_sdk/core/jsonable_encoder.py +120 -0
  22. prism_py_sdk-1.0.1/src/prism_py_sdk/core/logging.py +107 -0
  23. prism_py_sdk-1.0.1/src/prism_py_sdk/core/parse_error.py +36 -0
  24. prism_py_sdk-1.0.1/src/prism_py_sdk/core/pydantic_utilities.py +634 -0
  25. prism_py_sdk-1.0.1/src/prism_py_sdk/core/query_encoder.py +58 -0
  26. prism_py_sdk-1.0.1/src/prism_py_sdk/core/remove_none_from_dict.py +11 -0
  27. prism_py_sdk-1.0.1/src/prism_py_sdk/core/request_options.py +35 -0
  28. prism_py_sdk-1.0.1/src/prism_py_sdk/core/serialization.py +276 -0
  29. prism_py_sdk-1.0.1/src/prism_py_sdk/environment.py +7 -0
  30. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/__init__.py +44 -0
  31. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/bad_request_error.py +10 -0
  32. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/forbidden_error.py +10 -0
  33. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/internal_server_error.py +10 -0
  34. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/too_many_requests_error.py +10 -0
  35. prism_py_sdk-1.0.1/src/prism_py_sdk/errors/unauthorized_error.py +10 -0
  36. prism_py_sdk-1.0.1/src/prism_py_sdk/py.typed +0 -0
  37. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/__init__.py +52 -0
  38. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/client.py +63 -0
  39. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/__init__.py +49 -0
  40. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/client.py +1244 -0
  41. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/raw_client.py +2497 -0
  42. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/types/__init__.py +47 -0
  43. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/types/get_swaps_dex_response.py +21 -0
  44. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/types/get_trades_dex_response.py +21 -0
  45. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/types/search_token_profiles_dex_response.py +21 -0
  46. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/dex/types/search_wallet_profiles_dex_response.py +21 -0
  47. prism_py_sdk-1.0.1/src/prism_py_sdk/solana/raw_client.py +13 -0
  48. prism_py_sdk-1.0.1/src/prism_py_sdk/types/__init__.py +190 -0
  49. prism_py_sdk-1.0.1/src/prism_py_sdk/types/bad_request_error_body.py +19 -0
  50. prism_py_sdk-1.0.1/src/prism_py_sdk/types/forbidden_error_body.py +19 -0
  51. prism_py_sdk-1.0.1/src/prism_py_sdk/types/internal_server_error_body.py +19 -0
  52. prism_py_sdk-1.0.1/src/prism_py_sdk/types/paginated_response.py +27 -0
  53. prism_py_sdk-1.0.1/src/prism_py_sdk/types/payload_pagination.py +27 -0
  54. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_price.py +22 -0
  55. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_price_candle.py +25 -0
  56. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_price_history.py +21 -0
  57. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_price_snapshot.py +21 -0
  58. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_price_stats.py +105 -0
  59. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_dynamic_labels.py +5 -0
  60. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_dynamic_labels.py +11 -0
  61. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter.py +42 -0
  62. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter_operators.py +68 -0
  63. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter_operators_eq.py +5 -0
  64. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter_operators_in_item.py +5 -0
  65. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter_operators_ne.py +5 -0
  66. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_filter_operators_nin_item.py +5 -0
  67. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_query.py +41 -0
  68. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_sort.py +29 -0
  69. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_profile_search_payload_sort_direction_enum.py +5 -0
  70. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_protocol_field.py +6 -0
  71. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_swap.py +38 -0
  72. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_swap_type_enum.py +7 -0
  73. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile.py +33 -0
  74. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_label_enum.py +5 -0
  75. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_labels.py +7 -0
  76. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_market.py +27 -0
  77. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_metadata.py +30 -0
  78. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_metrics.py +64 -0
  79. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_payload_options.py +42 -0
  80. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_search_payload_query_field.py +42 -0
  81. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_search_payload_query_field_targets_enum.py +7 -0
  82. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_token_profile_time_window_enum.py +5 -0
  83. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_trade.py +42 -0
  84. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_trade_direction_enum.py +5 -0
  85. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_trade_position_state_enum.py +5 -0
  86. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile.py +33 -0
  87. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_identity.py +21 -0
  88. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_label_enum.py +7 -0
  89. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_labels.py +7 -0
  90. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_metadata.py +20 -0
  91. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_metrics.py +74 -0
  92. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_payload_options.py +37 -0
  93. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_search_payload_query.py +42 -0
  94. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_search_payload_query_targets_enum.py +8 -0
  95. prism_py_sdk-1.0.1/src/prism_py_sdk/types/solana_dex_wallet_profile_time_window_enum.py +5 -0
  96. prism_py_sdk-1.0.1/src/prism_py_sdk/types/too_many_requests_error_body.py +19 -0
  97. prism_py_sdk-1.0.1/src/prism_py_sdk/types/unauthorized_error_body.py +19 -0
  98. prism_py_sdk-1.0.1/src/prism_py_sdk/version.py +3 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Prism Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.1
2
+ Name: prism-py-sdk
3
+ Version: 1.0.1
4
+ Summary:
5
+ Requires-Python: >=3.10,<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.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.13.4,<4) ; (python_version >= "3.9") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (==0.1.8) ; (python_version >= "3.9") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Project-URL: Repository, https://github.com/prism-api/sdk-py
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Prism Python Library
33
+
34
+ [![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%2Fprism-api%2Fsdk-py)
35
+ [![pypi](https://img.shields.io/pypi/v/prism-py-sdk)](https://pypi.python.org/pypi/prism-py-sdk)
36
+
37
+ The Prism Python library provides convenient access to the Prism APIs from Python.
38
+
39
+ ## Table of Contents
40
+
41
+ - [Installation](#installation)
42
+ - [Reference](#reference)
43
+ - [Usage](#usage)
44
+ - [Environments](#environments)
45
+ - [Async Client](#async-client)
46
+ - [Exception Handling](#exception-handling)
47
+ - [Advanced](#advanced)
48
+ - [Access Raw Response Data](#access-raw-response-data)
49
+ - [Retries](#retries)
50
+ - [Timeouts](#timeouts)
51
+ - [Custom Client](#custom-client)
52
+ - [Contributing](#contributing)
53
+
54
+ ## Installation
55
+
56
+ ```sh
57
+ pip install prism-py-sdk
58
+ ```
59
+
60
+ ## Reference
61
+
62
+ A full reference for this library is available [here](https://github.com/prism-api/sdk-py/blob/HEAD/./reference.md).
63
+
64
+ ## Usage
65
+
66
+ Instantiate and use the client with the following:
67
+
68
+ ```python
69
+ from prism_py_sdk import ApiClient, SolanaDexWalletProfilePayloadOptions
70
+
71
+ client = ApiClient(
72
+ api_key="<value>",
73
+ )
74
+
75
+ client.solana.dex.get_wallet_profile(
76
+ wallet="suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
77
+ options=SolanaDexWalletProfilePayloadOptions(
78
+ include_metadata=True,
79
+ include_labels=True,
80
+ include_metrics=[
81
+ "7d"
82
+ ],
83
+ ),
84
+ )
85
+ ```
86
+
87
+ ## Environments
88
+
89
+ This SDK allows you to configure different environments for API requests.
90
+
91
+ ```python
92
+ from prism_py_sdk import ApiClient
93
+ from prism_py_sdk.environment import ApiClientEnvironment
94
+
95
+ client = ApiClient(
96
+ environment=ApiClientEnvironment.DEFAULT,
97
+ )
98
+ ```
99
+
100
+ ## Async Client
101
+
102
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
103
+
104
+ ```python
105
+ import asyncio
106
+
107
+ from prism_py_sdk import AsyncApiClient
108
+
109
+ client = AsyncApiClient(
110
+ api_key="<value>",
111
+ )
112
+
113
+
114
+ async def main() -> None:
115
+ await client.solana.dex.get_wallet_profile(
116
+ wallet="suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
117
+ options=SolanaDexWalletProfilePayloadOptions(
118
+ include_metadata=True,
119
+ include_labels=True,
120
+ include_metrics=[
121
+ "7d"
122
+ ],
123
+ ),
124
+ )
125
+
126
+
127
+ asyncio.run(main())
128
+ ```
129
+
130
+ ## Exception Handling
131
+
132
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
133
+ will be thrown.
134
+
135
+ ```python
136
+ from prism_py_sdk.core.api_error import ApiError
137
+
138
+ try:
139
+ client.solana.dex.get_wallet_profile(...)
140
+ except ApiError as e:
141
+ print(e.status_code)
142
+ print(e.body)
143
+ ```
144
+
145
+ ## Advanced
146
+
147
+ ### Access Raw Response Data
148
+
149
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
150
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
151
+
152
+ ```python
153
+ from prism_py_sdk import ApiClient
154
+
155
+ client = ApiClient(...)
156
+ response = client.solana.dex.with_raw_response.get_wallet_profile(...)
157
+ print(response.headers) # access the response headers
158
+ print(response.status_code) # access the response status code
159
+ print(response.data) # access the underlying object
160
+ ```
161
+
162
+ ### Retries
163
+
164
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
165
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
166
+ retry limit (default: 2).
167
+
168
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
169
+
170
+ **`legacy`** (current default): retries on
171
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
172
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
173
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
174
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
175
+
176
+ **`recommended`**: retries on
177
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
178
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
179
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
180
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
181
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
182
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
183
+
184
+ Use the `max_retries` request option to configure this behavior.
185
+
186
+ ```python
187
+ client.solana.dex.get_wallet_profile(..., request_options={
188
+ "max_retries": 1
189
+ })
190
+ ```
191
+
192
+ ### Timeouts
193
+
194
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
195
+
196
+ ```python
197
+ from prism_py_sdk import ApiClient
198
+
199
+ client = ApiClient(..., timeout=20.0)
200
+
201
+ # Override timeout for a specific method
202
+ client.solana.dex.get_wallet_profile(..., request_options={
203
+ "timeout_in_seconds": 1
204
+ })
205
+ ```
206
+
207
+ ### Custom Client
208
+
209
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
210
+ and transports.
211
+
212
+ ```python
213
+ import httpx
214
+ from prism_py_sdk import ApiClient
215
+
216
+ client = ApiClient(
217
+ ...,
218
+ httpx_client=httpx.Client(
219
+ proxy="http://my.test.proxy.example.com",
220
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
221
+ ),
222
+ )
223
+ ```
224
+
225
+ ## Contributing
226
+
227
+ While we value open-source contributions to this SDK, this library is generated programmatically.
228
+ Additions made directly to this library would have to be moved over to our generation code,
229
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
230
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
231
+ an issue first to discuss with us!
232
+
233
+ On the other hand, contributions to the README are always very welcome!
234
+
@@ -0,0 +1,202 @@
1
+ # Prism 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%2Fprism-api%2Fsdk-py)
4
+ [![pypi](https://img.shields.io/pypi/v/prism-py-sdk)](https://pypi.python.org/pypi/prism-py-sdk)
5
+
6
+ The Prism Python library provides convenient access to the Prism APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Environments](#environments)
14
+ - [Async Client](#async-client)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Access Raw Response Data](#access-raw-response-data)
18
+ - [Retries](#retries)
19
+ - [Timeouts](#timeouts)
20
+ - [Custom Client](#custom-client)
21
+ - [Contributing](#contributing)
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ pip install prism-py-sdk
27
+ ```
28
+
29
+ ## Reference
30
+
31
+ A full reference for this library is available [here](https://github.com/prism-api/sdk-py/blob/HEAD/./reference.md).
32
+
33
+ ## Usage
34
+
35
+ Instantiate and use the client with the following:
36
+
37
+ ```python
38
+ from prism_py_sdk import ApiClient, SolanaDexWalletProfilePayloadOptions
39
+
40
+ client = ApiClient(
41
+ api_key="<value>",
42
+ )
43
+
44
+ client.solana.dex.get_wallet_profile(
45
+ wallet="suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
46
+ options=SolanaDexWalletProfilePayloadOptions(
47
+ include_metadata=True,
48
+ include_labels=True,
49
+ include_metrics=[
50
+ "7d"
51
+ ],
52
+ ),
53
+ )
54
+ ```
55
+
56
+ ## Environments
57
+
58
+ This SDK allows you to configure different environments for API requests.
59
+
60
+ ```python
61
+ from prism_py_sdk import ApiClient
62
+ from prism_py_sdk.environment import ApiClientEnvironment
63
+
64
+ client = ApiClient(
65
+ environment=ApiClientEnvironment.DEFAULT,
66
+ )
67
+ ```
68
+
69
+ ## Async Client
70
+
71
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
72
+
73
+ ```python
74
+ import asyncio
75
+
76
+ from prism_py_sdk import AsyncApiClient
77
+
78
+ client = AsyncApiClient(
79
+ api_key="<value>",
80
+ )
81
+
82
+
83
+ async def main() -> None:
84
+ await client.solana.dex.get_wallet_profile(
85
+ wallet="suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
86
+ options=SolanaDexWalletProfilePayloadOptions(
87
+ include_metadata=True,
88
+ include_labels=True,
89
+ include_metrics=[
90
+ "7d"
91
+ ],
92
+ ),
93
+ )
94
+
95
+
96
+ asyncio.run(main())
97
+ ```
98
+
99
+ ## Exception Handling
100
+
101
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
102
+ will be thrown.
103
+
104
+ ```python
105
+ from prism_py_sdk.core.api_error import ApiError
106
+
107
+ try:
108
+ client.solana.dex.get_wallet_profile(...)
109
+ except ApiError as e:
110
+ print(e.status_code)
111
+ print(e.body)
112
+ ```
113
+
114
+ ## Advanced
115
+
116
+ ### Access Raw Response Data
117
+
118
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
119
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
120
+
121
+ ```python
122
+ from prism_py_sdk import ApiClient
123
+
124
+ client = ApiClient(...)
125
+ response = client.solana.dex.with_raw_response.get_wallet_profile(...)
126
+ print(response.headers) # access the response headers
127
+ print(response.status_code) # access the response status code
128
+ print(response.data) # access the underlying object
129
+ ```
130
+
131
+ ### Retries
132
+
133
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
134
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
135
+ retry limit (default: 2).
136
+
137
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
138
+
139
+ **`legacy`** (current default): retries on
140
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
141
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
142
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
143
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
144
+
145
+ **`recommended`**: retries on
146
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
147
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
148
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
149
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
150
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
151
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
152
+
153
+ Use the `max_retries` request option to configure this behavior.
154
+
155
+ ```python
156
+ client.solana.dex.get_wallet_profile(..., request_options={
157
+ "max_retries": 1
158
+ })
159
+ ```
160
+
161
+ ### Timeouts
162
+
163
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
164
+
165
+ ```python
166
+ from prism_py_sdk import ApiClient
167
+
168
+ client = ApiClient(..., timeout=20.0)
169
+
170
+ # Override timeout for a specific method
171
+ client.solana.dex.get_wallet_profile(..., request_options={
172
+ "timeout_in_seconds": 1
173
+ })
174
+ ```
175
+
176
+ ### Custom Client
177
+
178
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
179
+ and transports.
180
+
181
+ ```python
182
+ import httpx
183
+ from prism_py_sdk import ApiClient
184
+
185
+ client = ApiClient(
186
+ ...,
187
+ httpx_client=httpx.Client(
188
+ proxy="http://my.test.proxy.example.com",
189
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
190
+ ),
191
+ )
192
+ ```
193
+
194
+ ## Contributing
195
+
196
+ While we value open-source contributions to this SDK, this library is generated programmatically.
197
+ Additions made directly to this library would have to be moved over to our generation code,
198
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
199
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
200
+ an issue first to discuss with us!
201
+
202
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,96 @@
1
+ [project]
2
+ name = "prism-py-sdk"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "prism-py-sdk"
7
+ version = "1.0.1"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Operating System :: POSIX",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: Microsoft :: Windows",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed"
30
+ ]
31
+ packages = [
32
+ { include = "prism_py_sdk", from = "src"}
33
+ ]
34
+
35
+ [tool.poetry.urls]
36
+ Repository = 'https://github.com/prism-api/sdk-py'
37
+
38
+ [tool.poetry.dependencies]
39
+ python = "^3.10"
40
+ aiohttp = { version = ">=3.13.4,<4", optional = true, python = ">=3.9"}
41
+ httpx = ">=0.21.2"
42
+ httpx-aiohttp = { version = "0.1.8", optional = true, python = ">=3.9"}
43
+ pydantic = ">= 1.9.2"
44
+ pydantic-core = ">=2.18.2,<3.0.0"
45
+ typing_extensions = ">= 4.0.0"
46
+
47
+ [tool.poetry.group.dev.dependencies]
48
+ mypy = "==1.13.0"
49
+ pytest = "^9.0.3"
50
+ pytest-asyncio = "^1.0.0"
51
+ pytest-xdist = "^3.6.1"
52
+ python-dateutil = "^2.9.0"
53
+ types-python-dateutil = "^2.9.0.20240316"
54
+ urllib3 = ">=2.6.3,<3.0.0"
55
+ ruff = "==0.11.5"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = [ "tests" ]
59
+ asyncio_mode = "auto"
60
+ markers = [
61
+ "aiohttp: tests that require httpx_aiohttp to be installed",
62
+ ]
63
+
64
+ [tool.mypy]
65
+ plugins = ["pydantic.mypy"]
66
+
67
+ [tool.ruff]
68
+ line-length = 120
69
+
70
+ [tool.ruff.lint]
71
+ select = [
72
+ "E", # pycodestyle errors
73
+ "F", # pyflakes
74
+ "I", # isort
75
+ ]
76
+ ignore = [
77
+ "E402", # Module level import not at top of file
78
+ "E501", # Line too long
79
+ "E711", # Comparison to `None` should be `cond is not None`
80
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
81
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
82
+ "E722", # Do not use bare `except`
83
+ "E731", # Do not assign a `lambda` expression, use a `def`
84
+ "F821", # Undefined name
85
+ "F841" # Local variable ... is assigned to but never used
86
+ ]
87
+
88
+ [tool.ruff.lint.isort]
89
+ section-order = ["future", "standard-library", "third-party", "first-party"]
90
+
91
+ [build-system]
92
+ requires = ["poetry-core"]
93
+ build-backend = "poetry.core.masonry.api"
94
+
95
+ [tool.poetry.extras]
96
+ aiohttp=["aiohttp", "httpx-aiohttp"]