Skip to content

Commit ad84bcc

Browse files
feat: configure SDK packages
1 parent 35cda8b commit ad84bcc

234 files changed

Lines changed: 349 additions & 345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 87
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/keycard%2Fkeycard-api-cb43483cd1b31447c61507f94d93d50b047d98f1f81f6ffa54a860a38e929f5f.yml
33
openapi_spec_hash: d470e78a4feb376982d931be1ad7ea74
4-
config_hash: d1ee3a2b08b7b7afbcf32ca6ec2cbb82
4+
config_hash: b4fe4fa59f7e33256aae61c63fedb45d

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock
3636

3737
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
3838
result in merge conflicts between manual patches and changes from the generator. The generator will never
39-
modify the contents of the `src/keycard_api/lib/` and `examples/` directories.
39+
modify the contents of the `src/keycardai_api/lib/` and `examples/` directories.
4040

4141
## Adding and running examples
4242

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Keycard API Python API library
22

33
<!-- prettier-ignore -->
4-
[![PyPI version](https://img.shields.io/pypi/v/keycard_api.svg?label=pypi%20(stable))](https://pypi.org/project/keycard_api/)
4+
[![PyPI version](https://img.shields.io/pypi/v/keycardai-api.svg?label=pypi%20(stable))](https://pypi.org/project/keycardai-api/)
55

66
The Keycard API Python library provides convenient access to the Keycard API REST API from any Python 3.9+
77
application. The library includes type definitions for all request params and response fields,
@@ -17,15 +17,15 @@ The REST API documentation can be found on [docs.keycard.ai](https://docs.keycar
1717

1818
```sh
1919
# install from PyPI
20-
pip install keycard_api
20+
pip install keycardai-api
2121
```
2222

2323
## Usage
2424

2525
The full API of this library can be found in [api.md](api.md).
2626

2727
```python
28-
from keycard_api import KeycardAPI
28+
from keycardai_api import KeycardAPI
2929

3030
client = KeycardAPI()
3131

@@ -44,7 +44,7 @@ Simply import `AsyncKeycardAPI` instead of `KeycardAPI` and use `await` with eac
4444

4545
```python
4646
import asyncio
47-
from keycard_api import AsyncKeycardAPI
47+
from keycardai_api import AsyncKeycardAPI
4848

4949
client = AsyncKeycardAPI()
5050

@@ -67,15 +67,15 @@ You can enable this by installing `aiohttp`:
6767

6868
```sh
6969
# install from PyPI
70-
pip install keycard_api[aiohttp]
70+
pip install keycardai-api[aiohttp]
7171
```
7272

7373
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
7474

7575
```python
7676
import asyncio
77-
from keycard_api import DefaultAioHttpClient
78-
from keycard_api import AsyncKeycardAPI
77+
from keycardai_api import DefaultAioHttpClient
78+
from keycardai_api import AsyncKeycardAPI
7979

8080

8181
async def main() -> None:
@@ -103,7 +103,7 @@ Typed requests and responses provide autocomplete and documentation within your
103103
Nested parameters are dictionaries, typed using `TypedDict`, for example:
104104

105105
```python
106-
from keycard_api import KeycardAPI
106+
from keycardai_api import KeycardAPI
107107

108108
client = KeycardAPI()
109109

@@ -119,27 +119,27 @@ print(zone.encryption_key)
119119

120120
## Handling errors
121121

122-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `keycard_api.APIConnectionError` is raised.
122+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `keycardai_api.APIConnectionError` is raised.
123123

124124
When the API returns a non-success status code (that is, 4xx or 5xx
125-
response), a subclass of `keycard_api.APIStatusError` is raised, containing `status_code` and `response` properties.
125+
response), a subclass of `keycardai_api.APIStatusError` is raised, containing `status_code` and `response` properties.
126126

127-
All errors inherit from `keycard_api.APIError`.
127+
All errors inherit from `keycardai_api.APIError`.
128128

129129
```python
130-
import keycard_api
131-
from keycard_api import KeycardAPI
130+
import keycardai_api
131+
from keycardai_api import KeycardAPI
132132

133133
client = KeycardAPI()
134134

135135
try:
136136
client.zones.list()
137-
except keycard_api.APIConnectionError as e:
137+
except keycardai_api.APIConnectionError as e:
138138
print("The server could not be reached")
139139
print(e.__cause__) # an underlying Exception, likely raised within httpx.
140-
except keycard_api.RateLimitError as e:
140+
except keycardai_api.RateLimitError as e:
141141
print("A 429 status code was received; we should back off a bit.")
142-
except keycard_api.APIStatusError as e:
142+
except keycardai_api.APIStatusError as e:
143143
print("Another non-200-range status code was received")
144144
print(e.status_code)
145145
print(e.response)
@@ -167,7 +167,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
167167
You can use the `max_retries` option to configure or disable retry settings:
168168

169169
```python
170-
from keycard_api import KeycardAPI
170+
from keycardai_api import KeycardAPI
171171

172172
# Configure the default for all requests:
173173
client = KeycardAPI(
@@ -185,7 +185,7 @@ By default requests time out after 1 minute. You can configure this with a `time
185185
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
186186

187187
```python
188-
from keycard_api import KeycardAPI
188+
from keycardai_api import KeycardAPI
189189

190190
# Configure the default for all requests:
191191
client = KeycardAPI(
@@ -237,7 +237,7 @@ if response.my_field is None:
237237
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
238238

239239
```py
240-
from keycard_api import KeycardAPI
240+
from keycardai_api import KeycardAPI
241241

242242
client = KeycardAPI()
243243
response = client.zones.with_raw_response.list()
@@ -247,9 +247,9 @@ zone = response.parse() # get the object that `zones.list()` would have returne
247247
print(zone.items)
248248
```
249249

250-
These methods return an [`APIResponse`](https://github.com/keycardlabs/keycard-python/tree/main/src/keycard_api/_response.py) object.
250+
These methods return an [`APIResponse`](https://github.com/keycardlabs/keycard-python/tree/main/src/keycardai_api/_response.py) object.
251251

252-
The async client returns an [`AsyncAPIResponse`](https://github.com/keycardlabs/keycard-python/tree/main/src/keycard_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
252+
The async client returns an [`AsyncAPIResponse`](https://github.com/keycardlabs/keycard-python/tree/main/src/keycardai_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
253253

254254
#### `.with_streaming_response`
255255

@@ -311,7 +311,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
311311

312312
```python
313313
import httpx
314-
from keycard_api import KeycardAPI, DefaultHttpxClient
314+
from keycardai_api import KeycardAPI, DefaultHttpxClient
315315

316316
client = KeycardAPI(
317317
# Or use the `KEYCARD_API_BASE_URL` env var
@@ -334,7 +334,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
334334
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
335335

336336
```py
337-
from keycard_api import KeycardAPI
337+
from keycardai_api import KeycardAPI
338338

339339
with KeycardAPI() as client:
340340
# make requests here
@@ -362,8 +362,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
362362
You can determine the version that is being used at runtime with:
363363

364364
```py
365-
import keycard_api
366-
print(keycard_api.__version__)
365+
import keycardai_api
366+
print(keycardai_api.__version__)
367367
```
368368

369369
## Requirements

0 commit comments

Comments
 (0)