Skip to content

Commit a72cb63

Browse files
stainless-botrattrayalex
authored andcommitted
Clean up README formatting.
1 parent a4341df commit a72cb63

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ pip install lithic
2222
from lithic import Lithic
2323

2424
lithic = Lithic(
25-
api_key='my api key', # defaults to os.environ.get("LITHIC_API_KEY")
26-
environment='sandbox', # defaults to 'production'.
25+
# defaults to os.environ.get("LITHIC_API_KEY")
26+
api_key="my api key",
27+
# defaults to "production".
28+
environment="sandbox",
2729
)
2830

2931
card = lithic.cards.create({
@@ -44,8 +46,10 @@ Simply import `AsyncLithic` instead of `Lithic` and use `await` with each API ca
4446
from lithic import AsyncLithic
4547

4648
lithic = AsyncLithic(
47-
api_key='my api key', # defaults to os.environ.get("LITHIC_API_KEY")
48-
environment='sandbox', # defaults to 'production'.
49+
# defaults to os.environ.get("LITHIC_API_KEY")
50+
api_key="my api key",
51+
# defaults to "production".
52+
environment="sandbox",
4953
)
5054

5155
async def main():
@@ -149,12 +153,12 @@ try:
149153
"type": "an_incorrect_type"
150154
})
151155
except lithic.APIConnectionError as e:
152-
print('The server could not be reached')
156+
print("The server could not be reached")
153157
print(e.__cause__) # an underlying Exception, likely raised within httpx.
154158
except lithic.RateLimitError as e:
155-
print('A 429 status code was received; we should back off a bit.')
159+
print("A 429 status code was received; we should back off a bit.")
156160
except lithic.APIStatusError as e:
157-
print('Another non-200-range status code was received')
161+
print("Another non-200-range status code was received")
158162
print(e.status_code)
159163
print(e.response)
160164
```
@@ -185,8 +189,8 @@ from lithic import Lithic
185189

186190
# Configure the default for all requests:
187191
lithic = Lithic(
188-
# default is 2
189-
max_retries=0,
192+
# default is 2
193+
max_retries=0,
190194
)
191195

192196
# Or, configure per-request:
@@ -205,13 +209,13 @@ from lithic import Lithic
205209

206210
# Configure the default for all requests:
207211
lithic = Lithic(
208-
# default is 60s
209-
timeout=20.0,
212+
# default is 60s
213+
timeout=20.0,
210214
)
211215

212216
# More granular control:
213217
lithic = Lithic(
214-
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
218+
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
215219
)
216220

217221
# Override per-request:
@@ -233,10 +237,10 @@ import httpx
233237
from lithic import Lithic
234238

235239
lithic = Lithic(
236-
# Use a custom base URL
237-
base_url="http://my.test.server.example.com:8083",
238-
proxies="http://my.test.proxy.example.com",
239-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
240+
# Use a custom base URL
241+
base_url="http://my.test.server.example.com:8083",
242+
proxies="http://my.test.proxy.example.com",
243+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
240244
)
241245
```
242246

0 commit comments

Comments
 (0)