You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
@@ -47,7 +55,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
47
55
48
56
```python
49
57
# Synchronous Example
50
-
frompolarimport Polar
58
+
frompolar_sdkimport Polar
51
59
52
60
s = Polar(
53
61
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -72,7 +80,7 @@ The same SDK client can also be used to make asychronous requests by importing a
72
80
```python
73
81
# Asynchronous Example
74
82
import asyncio
75
-
frompolarimport Polar
83
+
frompolar_sdkimport Polar
76
84
77
85
asyncdefmain():
78
86
s = Polar(
@@ -235,7 +243,7 @@ Certain SDK methods accept file objects as part of a request body or multi-part
235
243
>
236
244
237
245
```python
238
-
frompolarimport Polar
246
+
frompolar_sdkimport Polar
239
247
240
248
s = Polar(
241
249
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -264,8 +272,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
264
272
265
273
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
266
274
```python
267
-
from polar import Polar
268
275
from polar.utils import BackoffStrategy, RetryConfig
276
+
from polar_sdk import Polar
269
277
270
278
s = Polar(
271
279
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -288,8 +296,8 @@ if res is not None:
288
296
289
297
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
290
298
```python
291
-
from polar import Polar
292
299
from polar.utils import BackoffStrategy, RetryConfig
@@ -324,7 +332,7 @@ Handling errors in this SDK should largely match your expectations. All operati
324
332
### Example
325
333
326
334
```python
327
-
frompolarimport Polar, models
335
+
frompolar_sdkimport Polar, models
328
336
329
337
s = Polar(
330
338
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -335,7 +343,7 @@ try:
335
343
res = s.users.benefits.list()
336
344
337
345
except models.HTTPValidationError as e:
338
-
# handle exception
346
+
# handle e.data: models.HTTPValidationErrorData
339
347
raise(e)
340
348
except models.SDKError as e:
341
349
# handle exception
@@ -367,7 +375,7 @@ You can override the default server globally by passing a server index to the `s
367
375
#### Example
368
376
369
377
```python
370
-
frompolarimport Polar
378
+
frompolar_sdkimport Polar
371
379
372
380
s = Polar(
373
381
server_idx=0,
@@ -393,7 +401,7 @@ if res is not None:
393
401
394
402
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
395
403
```python
396
-
frompolarimport Polar
404
+
frompolar_sdkimport Polar
397
405
398
406
s = Polar(
399
407
server_url="https://api.polar.sh",
@@ -424,7 +432,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu
424
432
425
433
For example, you could specify a header for every request that this sdk makes as follows:
0 commit comments