payi 0.1.0a18__py3-none-any.whl → 0.1.0a19__py3-none-any.whl
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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi/_client.py +24 -24
- payi/_version.py +1 -1
- {payi-0.1.0a18.dist-info → payi-0.1.0a19.dist-info}/METADATA +6 -6
- {payi-0.1.0a18.dist-info → payi-0.1.0a19.dist-info}/RECORD +6 -6
- {payi-0.1.0a18.dist-info → payi-0.1.0a19.dist-info}/WHEEL +0 -0
- {payi-0.1.0a18.dist-info → payi-0.1.0a19.dist-info}/licenses/LICENSE +0 -0
payi/_client.py
CHANGED
|
@@ -54,12 +54,12 @@ class Payi(SyncAPIClient):
|
|
|
54
54
|
with_streaming_response: PayiWithStreamedResponse
|
|
55
55
|
|
|
56
56
|
# client options
|
|
57
|
-
|
|
57
|
+
api_key: str
|
|
58
58
|
|
|
59
59
|
def __init__(
|
|
60
60
|
self,
|
|
61
61
|
*,
|
|
62
|
-
|
|
62
|
+
api_key: str | None = None,
|
|
63
63
|
base_url: str | httpx.URL | None = None,
|
|
64
64
|
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
|
|
65
65
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -81,15 +81,15 @@ class Payi(SyncAPIClient):
|
|
|
81
81
|
) -> None:
|
|
82
82
|
"""Construct a new synchronous payi client instance.
|
|
83
83
|
|
|
84
|
-
This automatically infers the `
|
|
84
|
+
This automatically infers the `api_key` argument from the `PAYI_API_KEY` environment variable if it is not provided.
|
|
85
85
|
"""
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
if
|
|
86
|
+
if api_key is None:
|
|
87
|
+
api_key = os.environ.get("PAYI_API_KEY")
|
|
88
|
+
if api_key is None:
|
|
89
89
|
raise PayiError(
|
|
90
|
-
"The
|
|
90
|
+
"The api_key client option must be set either by passing api_key to the client or by setting the PAYI_API_KEY environment variable"
|
|
91
91
|
)
|
|
92
|
-
self.
|
|
92
|
+
self.api_key = api_key
|
|
93
93
|
|
|
94
94
|
if base_url is None:
|
|
95
95
|
base_url = os.environ.get("PAYI_BASE_URL")
|
|
@@ -122,8 +122,8 @@ class Payi(SyncAPIClient):
|
|
|
122
122
|
@property
|
|
123
123
|
@override
|
|
124
124
|
def auth_headers(self) -> dict[str, str]:
|
|
125
|
-
|
|
126
|
-
return {"Authorization":
|
|
125
|
+
api_key = self.api_key
|
|
126
|
+
return {"Authorization": api_key}
|
|
127
127
|
|
|
128
128
|
@property
|
|
129
129
|
@override
|
|
@@ -137,7 +137,7 @@ class Payi(SyncAPIClient):
|
|
|
137
137
|
def copy(
|
|
138
138
|
self,
|
|
139
139
|
*,
|
|
140
|
-
|
|
140
|
+
api_key: str | None = None,
|
|
141
141
|
base_url: str | httpx.URL | None = None,
|
|
142
142
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
143
143
|
http_client: httpx.Client | None = None,
|
|
@@ -171,7 +171,7 @@ class Payi(SyncAPIClient):
|
|
|
171
171
|
|
|
172
172
|
http_client = http_client or self._client
|
|
173
173
|
return self.__class__(
|
|
174
|
-
|
|
174
|
+
api_key=api_key or self.api_key,
|
|
175
175
|
base_url=base_url or self.base_url,
|
|
176
176
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
177
177
|
http_client=http_client,
|
|
@@ -228,12 +228,12 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
228
228
|
with_streaming_response: AsyncPayiWithStreamedResponse
|
|
229
229
|
|
|
230
230
|
# client options
|
|
231
|
-
|
|
231
|
+
api_key: str
|
|
232
232
|
|
|
233
233
|
def __init__(
|
|
234
234
|
self,
|
|
235
235
|
*,
|
|
236
|
-
|
|
236
|
+
api_key: str | None = None,
|
|
237
237
|
base_url: str | httpx.URL | None = None,
|
|
238
238
|
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
|
|
239
239
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -255,15 +255,15 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
255
255
|
) -> None:
|
|
256
256
|
"""Construct a new async payi client instance.
|
|
257
257
|
|
|
258
|
-
This automatically infers the `
|
|
258
|
+
This automatically infers the `api_key` argument from the `PAYI_API_KEY` environment variable if it is not provided.
|
|
259
259
|
"""
|
|
260
|
-
if
|
|
261
|
-
|
|
262
|
-
if
|
|
260
|
+
if api_key is None:
|
|
261
|
+
api_key = os.environ.get("PAYI_API_KEY")
|
|
262
|
+
if api_key is None:
|
|
263
263
|
raise PayiError(
|
|
264
|
-
"The
|
|
264
|
+
"The api_key client option must be set either by passing api_key to the client or by setting the PAYI_API_KEY environment variable"
|
|
265
265
|
)
|
|
266
|
-
self.
|
|
266
|
+
self.api_key = api_key
|
|
267
267
|
|
|
268
268
|
if base_url is None:
|
|
269
269
|
base_url = os.environ.get("PAYI_BASE_URL")
|
|
@@ -296,8 +296,8 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
296
296
|
@property
|
|
297
297
|
@override
|
|
298
298
|
def auth_headers(self) -> dict[str, str]:
|
|
299
|
-
|
|
300
|
-
return {"Authorization":
|
|
299
|
+
api_key = self.api_key
|
|
300
|
+
return {"Authorization": api_key}
|
|
301
301
|
|
|
302
302
|
@property
|
|
303
303
|
@override
|
|
@@ -311,7 +311,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
311
311
|
def copy(
|
|
312
312
|
self,
|
|
313
313
|
*,
|
|
314
|
-
|
|
314
|
+
api_key: str | None = None,
|
|
315
315
|
base_url: str | httpx.URL | None = None,
|
|
316
316
|
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
|
|
317
317
|
http_client: httpx.AsyncClient | None = None,
|
|
@@ -345,7 +345,7 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
345
345
|
|
|
346
346
|
http_client = http_client or self._client
|
|
347
347
|
return self.__class__(
|
|
348
|
-
|
|
348
|
+
api_key=api_key or self.api_key,
|
|
349
349
|
base_url=base_url or self.base_url,
|
|
350
350
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
351
351
|
http_client=http_client,
|
payi/_version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a19
|
|
4
4
|
Summary: The official Python library for the payi API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Pay-i/pay-i-python
|
|
@@ -63,7 +63,7 @@ from payi import Payi
|
|
|
63
63
|
|
|
64
64
|
client = Payi(
|
|
65
65
|
# This is the default and can be omitted
|
|
66
|
-
|
|
66
|
+
api_key=os.environ.get("PAYI_API_KEY"),
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
budget_response = client.budgets.create(
|
|
@@ -73,10 +73,10 @@ budget_response = client.budgets.create(
|
|
|
73
73
|
print(budget_response.request_id)
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
While you can provide
|
|
76
|
+
While you can provide an `api_key` keyword argument,
|
|
77
77
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
78
|
-
to add `PAYI_API_KEY="My
|
|
79
|
-
so that your
|
|
78
|
+
to add `PAYI_API_KEY="My API Key"` to your `.env` file
|
|
79
|
+
so that your API Key is not stored in source control.
|
|
80
80
|
|
|
81
81
|
## Async usage
|
|
82
82
|
|
|
@@ -89,7 +89,7 @@ from payi import AsyncPayi
|
|
|
89
89
|
|
|
90
90
|
client = AsyncPayi(
|
|
91
91
|
# This is the default and can be omitted
|
|
92
|
-
|
|
92
|
+
api_key=os.environ.get("PAYI_API_KEY"),
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
payi/__init__.py,sha256=LWpfR6WSMPTnmmx3ToqqZ0A8CNduLcuxY1SSOqhPxuk,2381
|
|
2
2
|
payi/_base_client.py,sha256=ceMQR7sfWlJfFsA91UJzG4MT-QnPJ3jhqe-EpEmpRBo,66460
|
|
3
|
-
payi/_client.py,sha256=
|
|
3
|
+
payi/_client.py,sha256=RxYPuTG7ZWoSmp_FrUVcWyC_64nov_7_OvrwEM_8NN0,16672
|
|
4
4
|
payi/_compat.py,sha256=FgGcnNlyW7uHKyGh_Wvo7qZi-zVPmHx7mhb3F1GEZSw,6430
|
|
5
5
|
payi/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
|
|
6
6
|
payi/_exceptions.py,sha256=ItygKNrNXIVY0H6LsGVZvFuAHB3Vtm_VZXmWzCnpHy0,3216
|
|
@@ -11,7 +11,7 @@ payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
|
|
|
11
11
|
payi/_response.py,sha256=SByCajzglbiy7lSG4F5enqb7R6jVQe1OQ9TBsaxWzE8,28508
|
|
12
12
|
payi/_streaming.py,sha256=Z_wIyo206T6Jqh2rolFg2VXZgX24PahLmpURp0-NssU,10092
|
|
13
13
|
payi/_types.py,sha256=mb6zn5qmTK5j0QMh0fevdShT091HBL4w0YCUfQ3u5VY,6101
|
|
14
|
-
payi/_version.py,sha256=
|
|
14
|
+
payi/_version.py,sha256=r2I6EoEpyXSsRHrr-YGieiuVJuLBeJ1TFdvyoxl1C0M,165
|
|
15
15
|
payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
payi/_utils/__init__.py,sha256=Uzq1-FIih_VUjzdNVWXks0sdC39KBKLMrZoz-_JOjJ4,1988
|
|
17
17
|
payi/_utils/_logs.py,sha256=fmnf5D9TOgkgZKfgYmSa3PiUc3SZgkchn6CzJUeo0SQ,768
|
|
@@ -77,7 +77,7 @@ payi/types/experiences/experience_type.py,sha256=KKjkfI0eaoB1TmTlA4UpHKa2fB1q0zX
|
|
|
77
77
|
payi/types/experiences/type_create_params.py,sha256=8dNpffodzeD5vm3s6UJrZVOG7YsiTkXo7viDnoEoCZY,311
|
|
78
78
|
payi/types/experiences/type_list_response.py,sha256=DgkPLw40oUqBETLePVMVenstMsGG12rZRU9w6kgQN28,280
|
|
79
79
|
payi/types/experiences/type_update_params.py,sha256=ziUJASn8QF_5nSp5lohT0HLK0tTOciT-X35CVH9dA5Q,329
|
|
80
|
-
payi-0.1.
|
|
81
|
-
payi-0.1.
|
|
82
|
-
payi-0.1.
|
|
83
|
-
payi-0.1.
|
|
80
|
+
payi-0.1.0a19.dist-info/METADATA,sha256=WFx8h-5mWHQc1pGsd6rtQztLiG3ZNqUyIcNUqT0OiBY,12006
|
|
81
|
+
payi-0.1.0a19.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
82
|
+
payi-0.1.0a19.dist-info/licenses/LICENSE,sha256=8vX1pjh3esb6D5DvXAf6NxiBcVyon8aHWNJCxmmHXeY,11334
|
|
83
|
+
payi-0.1.0a19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|