@@ -65,11 +65,11 @@ The full API of this library can be found with code samples at [docs.conductor.i
6565import os
6666from conductor import Conductor
6767
68- client = Conductor(
68+ conductor = Conductor(
6969 api_key = os.environ.get(" CONDUCTOR_SECRET_KEY" ), # This is the default and can be omitted
7070)
7171
72- page = client .qbd.invoices.list(
72+ page = conductor .qbd.invoices.list(
7373 conductor_end_user_id = " YOUR_END_USER_ID" ,
7474)
7575print (page.data)
@@ -89,13 +89,13 @@ import os
8989import asyncio
9090from conductor import AsyncConductor
9191
92- client = AsyncConductor(
92+ conductor = AsyncConductor(
9393 api_key = os.environ.get(" CONDUCTOR_SECRET_KEY" ), # This is the default and can be omitted
9494)
9595
9696
9797async def main () -> None :
98- page = await client .qbd.invoices.list(
98+ page = await conductor .qbd.invoices.list(
9999 conductor_end_user_id = " YOUR_END_USER_ID" ,
100100 )
101101 print (page.data)
@@ -129,8 +129,8 @@ async def main() -> None:
129129 async with AsyncConductor(
130130 api_key = " sk_conductor_..." ,
131131 http_client = DefaultAioHttpClient(),
132- ) as client :
133- page = await client .qbd.invoices.list(
132+ ) as conductor :
133+ page = await conductor .qbd.invoices.list(
134134 conductor_end_user_id = " YOUR_END_USER_ID" ,
135135 )
136136 print (page.data)
@@ -157,11 +157,11 @@ This library provides auto-paginating iterators with each list response, so you
157157``` python
158158from conductor import Conductor
159159
160- client = Conductor()
160+ conductor = Conductor()
161161
162162all_invoices = []
163163# Automatically fetches more pages as needed.
164- for invoice in client .qbd.invoices.list(
164+ for invoice in conductor .qbd.invoices.list(
165165 conductor_end_user_id = " YOUR_END_USER_ID" ,
166166):
167167 # Do something with invoice here
@@ -175,13 +175,13 @@ Or, asynchronously:
175175import asyncio
176176from conductor import AsyncConductor
177177
178- client = AsyncConductor()
178+ conductor = AsyncConductor()
179179
180180
181181async def main () -> None :
182182 all_invoices = []
183183 # Iterate through items across all pages, issuing requests as needed.
184- async for invoice in client .qbd.invoices.list(
184+ async for invoice in conductor .qbd.invoices.list(
185185 conductor_end_user_id = " YOUR_END_USER_ID" ,
186186 ):
187187 all_invoices.append(invoice)
@@ -194,7 +194,7 @@ asyncio.run(main())
194194Alternatively, you can use the ` .has_next_page() ` , ` .next_page_info() ` , or ` .get_next_page() ` methods for more granular control working with pages:
195195
196196``` python
197- first_page = await client .qbd.invoices.list(
197+ first_page = await conductor .qbd.invoices.list(
198198 conductor_end_user_id = " YOUR_END_USER_ID" ,
199199)
200200if first_page.has_next_page():
@@ -208,7 +208,7 @@ if first_page.has_next_page():
208208Or just work directly with the returned data:
209209
210210``` python
211- first_page = await client .qbd.invoices.list(
211+ first_page = await conductor .qbd.invoices.list(
212212 conductor_end_user_id = " YOUR_END_USER_ID" ,
213213)
214214
@@ -228,9 +228,9 @@ Nested parameters are dictionaries, typed using `TypedDict`, for example:
228228``` python
229229from conductor import Conductor
230230
231- client = Conductor()
231+ conductor = Conductor()
232232
233- bill = client .qbd.bills.create(
233+ bill = conductor .qbd.bills.create(
234234 transaction_date = date.fromisoformat(" 2021-10-01" ),
235235 vendor_id = " 80000001-1234567890" ,
236236 conductor_end_user_id = " end_usr_1234567abcdefg" ,
@@ -252,10 +252,10 @@ All errors inherit from `conductor.APIError`.
252252import conductor
253253from conductor import Conductor
254254
255- client = Conductor()
255+ conductor = Conductor()
256256
257257try :
258- client .qbd.invoices.list(
258+ conductor .qbd.invoices.list(
259259 conductor_end_user_id = " YOUR_END_USER_ID" ,
260260 )
261261except conductor.APIConnectionError as e:
@@ -294,13 +294,13 @@ You can use the `max_retries` option to configure or disable retry settings:
294294from conductor import Conductor
295295
296296# Configure the default for all requests:
297- client = Conductor(
297+ conductor = Conductor(
298298 # default is 2
299299 max_retries = 0 ,
300300)
301301
302302# Or, configure per-request:
303- client .with_options(max_retries = 5 ).qbd.invoices.list(
303+ conductor .with_options(max_retries = 5 ).qbd.invoices.list(
304304 conductor_end_user_id = " YOUR_END_USER_ID" ,
305305)
306306```
@@ -314,18 +314,18 @@ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advan
314314from conductor import Conductor
315315
316316# Configure the default for all requests:
317- client = Conductor(
317+ conductor = Conductor(
318318 # 20 seconds (default is 2 minutes)
319319 timeout = 20.0 ,
320320)
321321
322322# More granular control:
323- client = Conductor(
323+ conductor = Conductor(
324324 timeout = httpx.Timeout(60.0 , read = 5.0 , write = 10.0 , connect = 2.0 ),
325325)
326326
327327# Override per-request:
328- client .with_options(timeout = 5.0 ).qbd.invoices.list(
328+ conductor .with_options(timeout = 5.0 ).qbd.invoices.list(
329329 conductor_end_user_id = " YOUR_END_USER_ID" ,
330330)
331331```
@@ -367,8 +367,8 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
367367``` py
368368from conductor import Conductor
369369
370- client = Conductor()
371- response = client .qbd.invoices.with_raw_response.list(
370+ conductor = Conductor()
371+ response = conductor .qbd.invoices.with_raw_response.list(
372372 conductor_end_user_id = " YOUR_END_USER_ID" ,
373373)
374374print (response.headers.get(' X-My-Header' ))
@@ -388,7 +388,7 @@ The above interface eagerly reads the full response body when you make the reque
388388To stream the response body, use ` .with_streaming_response ` instead, which requires a context manager and only reads the response body once you call ` .read() ` , ` .text() ` , ` .json() ` , ` .iter_bytes() ` , ` .iter_text() ` , ` .iter_lines() ` or ` .parse() ` . In the async client, these are async methods.
389389
390390``` python
391- with client .qbd.invoices.with_streaming_response.list(
391+ with conductor .qbd.invoices.with_streaming_response.list(
392392 conductor_end_user_id = " YOUR_END_USER_ID" ,
393393) as response:
394394 print (response.headers.get(" X-My-Header" ))
@@ -407,13 +407,13 @@ If you need to access undocumented endpoints, params, or response properties, th
407407
408408#### Undocumented endpoints
409409
410- To make requests to undocumented endpoints, you can make requests using ` client .get` , ` client .post` , and other
410+ To make requests to undocumented endpoints, you can make requests using ` conductor .get` , ` conductor .post` , and other
411411http verbs. Options on the client will be respected (such as retries) when making this request.
412412
413413``` py
414414import httpx
415415
416- response = client .post(
416+ response = conductor .post(
417417 " /foo" ,
418418 cast_to = httpx.Response,
419419 body = {" my_param" : True },
@@ -445,7 +445,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
445445import httpx
446446from conductor import Conductor, DefaultHttpxClient
447447
448- client = Conductor(
448+ conductor = Conductor(
449449 # Or use the `CONDUCTOR_BASE_URL` env var
450450 base_url = " http://my.test.server.example.com:8083" ,
451451 http_client = DefaultHttpxClient(
@@ -458,7 +458,7 @@ client = Conductor(
458458You can also customize the client on a per-request basis by using ` with_options() ` :
459459
460460``` python
461- client .with_options(http_client = DefaultHttpxClient(... ))
461+ conductor .with_options(http_client = DefaultHttpxClient(... ))
462462```
463463
464464### Managing HTTP resources
@@ -468,7 +468,7 @@ By default the library closes underlying HTTP connections whenever the client is
468468``` py
469469from conductor import Conductor
470470
471- with Conductor() as client :
471+ with Conductor() as conductor :
472472 # make requests here
473473 ...
474474
0 commit comments