nimble_python 0.1.0__tar.gz → 0.2.0__tar.gz
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.
- nimble_python-0.2.0/.release-please-manifest.json +3 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/CHANGELOG.md +14 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/LICENSE +1 -1
- {nimble_python-0.1.0 → nimble_python-0.2.0}/PKG-INFO +44 -41
- {nimble_python-0.1.0 → nimble_python-0.2.0}/README.md +41 -38
- {nimble_python-0.1.0 → nimble_python-0.2.0}/SECURITY.md +2 -2
- {nimble_python-0.1.0 → nimble_python-0.2.0}/api.md +1 -1
- {nimble_python-0.1.0 → nimble_python-0.2.0}/pyproject.toml +3 -3
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/__init__.py +6 -6
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_client.py +37 -37
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_exceptions.py +2 -2
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_resource.py +5 -5
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_response.py +2 -2
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_streaming.py +3 -3
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_logs.py +1 -1
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_version.py +1 -1
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/api_resources/test_client.py +31 -31
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/api_resources/test_crawl.py +33 -33
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/conftest.py +5 -5
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_client.py +128 -122
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_response.py +13 -13
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_streaming.py +15 -15
- {nimble_python-0.1.0 → nimble_python-0.2.0}/uv.lock +1 -1
- nimble_python-0.1.0/.release-please-manifest.json +0 -3
- {nimble_python-0.1.0 → nimble_python-0.2.0}/.gitignore +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/CONTRIBUTING.md +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/bin/check-release-environment +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/bin/publish-pypi +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/examples/.keep +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/release-please-config.json +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/requirements-dev.lock +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_base_client.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_compat.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_constants.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_files.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_models.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_qs.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_types.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/__init__.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_compat.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_datetime_parse.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_json.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_proxy.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_reflection.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_resources_proxy.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_streams.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_sync.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_transform.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_typing.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/_utils/_utils.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/lib/.keep +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/py.typed +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/resources/__init__.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/resources/crawl.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/__init__.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/client_extract_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/client_extract_template_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/client_map_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/client_search_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_list_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_list_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_root_params.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_root_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_status_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/crawl_terminate_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/extract_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/extract_template_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/map_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimble_python/types/search_response.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/src/nimbleway/lib/.keep +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/__init__.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/api_resources/__init__.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/sample_file.txt +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_deepcopy.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_extract_files.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_files.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_models.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_qs.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_required_args.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_transform.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_utils/test_json.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_utils/test_proxy.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/test_utils/test_typing.py +0 -0
- {nimble_python-0.1.0 → nimble_python-0.2.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 (2026-02-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Nimbleway/nimble-python/compare/v0.1.0...v0.2.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([dbbb503](https://github.com/Nimbleway/nimble-python/commit/dbbb503d1ba49d48f7159cf792e41a5fbcaf0461))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **api:** Revert to gateway.webit.live ([45b8b23](https://github.com/Nimbleway/nimble-python/commit/45b8b23f99cc5215d298eedb5457bca62ecc8da7))
|
|
15
|
+
* update SDK settings ([785c2e1](https://github.com/Nimbleway/nimble-python/commit/785c2e1efa3922961dd8dc6130eb8e122a2eec1e))
|
|
16
|
+
|
|
3
17
|
## 0.1.0 (2026-02-03)
|
|
4
18
|
|
|
5
19
|
Full Changelog: [v0.0.1...v0.1.0](https://github.com/Nimbleway/nimble-python/compare/v0.0.1...v0.1.0)
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2026
|
|
189
|
+
Copyright 2026 Nimbleway
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nimble_python
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The official Python library for the
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: The official Python library for the nimbleway API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nimbleway/nimble-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Nimbleway/nimble-python
|
|
7
|
-
Author-email:
|
|
7
|
+
Author-email: Nimbleway <support@nimbleway.com>
|
|
8
8
|
License: Apache-2.0
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -33,12 +33,12 @@ Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
|
33
33
|
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
|
-
#
|
|
36
|
+
# Nimbleway Python API library
|
|
37
37
|
|
|
38
38
|
<!-- prettier-ignore -->
|
|
39
39
|
[)](https://pypi.org/project/nimble_python/)
|
|
40
40
|
|
|
41
|
-
The
|
|
41
|
+
The Nimbleway Python library provides convenient access to the Nimbleway REST API from any Python 3.9+
|
|
42
42
|
application. The library includes type definitions for all request params and response fields,
|
|
43
43
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
44
44
|
|
|
@@ -46,10 +46,10 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
|
46
46
|
|
|
47
47
|
## MCP Server
|
|
48
48
|
|
|
49
|
-
Use the
|
|
49
|
+
Use the Nimbleway MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
50
50
|
|
|
51
|
-
[](https://cursor.com/en-US/install-mcp?name=nimble-mcp&config=
|
|
52
|
-
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22nimble-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fnimbleway.stlmcp.com%22%2C%22headers%22%3A%7B%22x-
|
|
51
|
+
[](https://cursor.com/en-US/install-mcp?name=nimble-mcp&config=eyJuYW1lIjoibmltYmxlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL25pbWJsZXdheS5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LW5pbWJsZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
|
|
52
|
+
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22nimble-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fnimbleway.stlmcp.com%22%2C%22headers%22%3A%7B%22x-nimble-api-key%22%3A%22My%20API%20Key%22%7D%7D)
|
|
53
53
|
|
|
54
54
|
> Note: You may need to set environment variables in your MCP client.
|
|
55
55
|
|
|
@@ -60,20 +60,23 @@ The full API of this library can be found in [api.md](https://github.com/Nimblew
|
|
|
60
60
|
## Installation
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
# install from
|
|
64
|
-
pip install
|
|
63
|
+
# install from the production repo
|
|
64
|
+
pip install git+ssh://git@github.com/Nimbleway/nimble-python.git
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
> [!NOTE]
|
|
68
|
+
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install nimble_python`
|
|
69
|
+
|
|
67
70
|
## Usage
|
|
68
71
|
|
|
69
72
|
The full API of this library can be found in [api.md](https://github.com/Nimbleway/nimble-python/tree/main/api.md).
|
|
70
73
|
|
|
71
74
|
```python
|
|
72
75
|
import os
|
|
73
|
-
from nimble_python import
|
|
76
|
+
from nimble_python import Nimbleway
|
|
74
77
|
|
|
75
|
-
client =
|
|
76
|
-
api_key=os.environ.get("
|
|
78
|
+
client = Nimbleway(
|
|
79
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
77
80
|
# defaults to "staging".
|
|
78
81
|
environment="production",
|
|
79
82
|
)
|
|
@@ -87,20 +90,20 @@ print(response.id)
|
|
|
87
90
|
|
|
88
91
|
While you can provide an `api_key` keyword argument,
|
|
89
92
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
90
|
-
to add `
|
|
93
|
+
to add `NIMBLE_API_KEY="My API Key"` to your `.env` file
|
|
91
94
|
so that your API Key is not stored in source control.
|
|
92
95
|
|
|
93
96
|
## Async usage
|
|
94
97
|
|
|
95
|
-
Simply import `
|
|
98
|
+
Simply import `AsyncNimbleway` instead of `Nimbleway` and use `await` with each API call:
|
|
96
99
|
|
|
97
100
|
```python
|
|
98
101
|
import os
|
|
99
102
|
import asyncio
|
|
100
|
-
from nimble_python import
|
|
103
|
+
from nimble_python import AsyncNimbleway
|
|
101
104
|
|
|
102
|
-
client =
|
|
103
|
-
api_key=os.environ.get("
|
|
105
|
+
client = AsyncNimbleway(
|
|
106
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
104
107
|
# defaults to "staging".
|
|
105
108
|
environment="production",
|
|
106
109
|
)
|
|
@@ -126,8 +129,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
|
|
|
126
129
|
You can enable this by installing `aiohttp`:
|
|
127
130
|
|
|
128
131
|
```sh
|
|
129
|
-
# install from
|
|
130
|
-
pip install nimble_python[aiohttp]
|
|
132
|
+
# install from the production repo
|
|
133
|
+
pip install 'nimble_python[aiohttp] @ git+ssh://git@github.com/Nimbleway/nimble-python.git'
|
|
131
134
|
```
|
|
132
135
|
|
|
133
136
|
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
@@ -136,12 +139,12 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
|
|
|
136
139
|
import os
|
|
137
140
|
import asyncio
|
|
138
141
|
from nimble_python import DefaultAioHttpClient
|
|
139
|
-
from nimble_python import
|
|
142
|
+
from nimble_python import AsyncNimbleway
|
|
140
143
|
|
|
141
144
|
|
|
142
145
|
async def main() -> None:
|
|
143
|
-
async with
|
|
144
|
-
api_key=os.environ.get("
|
|
146
|
+
async with AsyncNimbleway(
|
|
147
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
145
148
|
http_client=DefaultAioHttpClient(),
|
|
146
149
|
) as client:
|
|
147
150
|
response = await client.extract(
|
|
@@ -168,9 +171,9 @@ Typed requests and responses provide autocomplete and documentation within your
|
|
|
168
171
|
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
169
172
|
|
|
170
173
|
```python
|
|
171
|
-
from nimble_python import
|
|
174
|
+
from nimble_python import Nimbleway
|
|
172
175
|
|
|
173
|
-
client =
|
|
176
|
+
client = Nimbleway()
|
|
174
177
|
|
|
175
178
|
response = client.extract(
|
|
176
179
|
debug_options={},
|
|
@@ -190,9 +193,9 @@ All errors inherit from `nimble_python.APIError`.
|
|
|
190
193
|
|
|
191
194
|
```python
|
|
192
195
|
import nimble_python
|
|
193
|
-
from nimble_python import
|
|
196
|
+
from nimble_python import Nimbleway
|
|
194
197
|
|
|
195
|
-
client =
|
|
198
|
+
client = Nimbleway()
|
|
196
199
|
|
|
197
200
|
try:
|
|
198
201
|
client.extract(
|
|
@@ -232,10 +235,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
|
232
235
|
You can use the `max_retries` option to configure or disable retry settings:
|
|
233
236
|
|
|
234
237
|
```python
|
|
235
|
-
from nimble_python import
|
|
238
|
+
from nimble_python import Nimbleway
|
|
236
239
|
|
|
237
240
|
# Configure the default for all requests:
|
|
238
|
-
client =
|
|
241
|
+
client = Nimbleway(
|
|
239
242
|
# default is 2
|
|
240
243
|
max_retries=0,
|
|
241
244
|
)
|
|
@@ -253,16 +256,16 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
|
253
256
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
254
257
|
|
|
255
258
|
```python
|
|
256
|
-
from nimble_python import
|
|
259
|
+
from nimble_python import Nimbleway
|
|
257
260
|
|
|
258
261
|
# Configure the default for all requests:
|
|
259
|
-
client =
|
|
262
|
+
client = Nimbleway(
|
|
260
263
|
# 20 seconds (default is 1 minute)
|
|
261
264
|
timeout=20.0,
|
|
262
265
|
)
|
|
263
266
|
|
|
264
267
|
# More granular control:
|
|
265
|
-
client =
|
|
268
|
+
client = Nimbleway(
|
|
266
269
|
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
|
|
267
270
|
)
|
|
268
271
|
|
|
@@ -283,10 +286,10 @@ Note that requests that time out are [retried twice by default](https://github.c
|
|
|
283
286
|
|
|
284
287
|
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
|
|
285
288
|
|
|
286
|
-
You can enable logging by setting the environment variable `
|
|
289
|
+
You can enable logging by setting the environment variable `NIMBLEWAY_LOG` to `info`.
|
|
287
290
|
|
|
288
291
|
```shell
|
|
289
|
-
$ export
|
|
292
|
+
$ export NIMBLEWAY_LOG=info
|
|
290
293
|
```
|
|
291
294
|
|
|
292
295
|
Or to `debug` for more verbose logging.
|
|
@@ -308,9 +311,9 @@ if response.my_field is None:
|
|
|
308
311
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
|
309
312
|
|
|
310
313
|
```py
|
|
311
|
-
from nimble_python import
|
|
314
|
+
from nimble_python import Nimbleway
|
|
312
315
|
|
|
313
|
-
client =
|
|
316
|
+
client = Nimbleway()
|
|
314
317
|
response = client.with_raw_response.extract(
|
|
315
318
|
debug_options={},
|
|
316
319
|
url="https://example.com",
|
|
@@ -388,10 +391,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
|
388
391
|
|
|
389
392
|
```python
|
|
390
393
|
import httpx
|
|
391
|
-
from nimble_python import
|
|
394
|
+
from nimble_python import Nimbleway, DefaultHttpxClient
|
|
392
395
|
|
|
393
|
-
client =
|
|
394
|
-
# Or use the `
|
|
396
|
+
client = Nimbleway(
|
|
397
|
+
# Or use the `NIMBLEWAY_BASE_URL` env var
|
|
395
398
|
base_url="http://my.test.server.example.com:8083",
|
|
396
399
|
http_client=DefaultHttpxClient(
|
|
397
400
|
proxy="http://my.test.proxy.example.com",
|
|
@@ -411,9 +414,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
|
411
414
|
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.
|
|
412
415
|
|
|
413
416
|
```py
|
|
414
|
-
from nimble_python import
|
|
417
|
+
from nimble_python import Nimbleway
|
|
415
418
|
|
|
416
|
-
with
|
|
419
|
+
with Nimbleway() as client:
|
|
417
420
|
# make requests here
|
|
418
421
|
...
|
|
419
422
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nimbleway Python API library
|
|
2
2
|
|
|
3
3
|
<!-- prettier-ignore -->
|
|
4
4
|
[)](https://pypi.org/project/nimble_python/)
|
|
5
5
|
|
|
6
|
-
The
|
|
6
|
+
The Nimbleway Python library provides convenient access to the Nimbleway REST API from any Python 3.9+
|
|
7
7
|
application. The library includes type definitions for all request params and response fields,
|
|
8
8
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
9
9
|
|
|
@@ -11,10 +11,10 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
|
11
11
|
|
|
12
12
|
## MCP Server
|
|
13
13
|
|
|
14
|
-
Use the
|
|
14
|
+
Use the Nimbleway MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
15
15
|
|
|
16
|
-
[](https://cursor.com/en-US/install-mcp?name=nimble-mcp&config=
|
|
17
|
-
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22nimble-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fnimbleway.stlmcp.com%22%2C%22headers%22%3A%7B%22x-
|
|
16
|
+
[](https://cursor.com/en-US/install-mcp?name=nimble-mcp&config=eyJuYW1lIjoibmltYmxlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL25pbWJsZXdheS5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LW5pbWJsZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
|
|
17
|
+
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22nimble-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fnimbleway.stlmcp.com%22%2C%22headers%22%3A%7B%22x-nimble-api-key%22%3A%22My%20API%20Key%22%7D%7D)
|
|
18
18
|
|
|
19
19
|
> Note: You may need to set environment variables in your MCP client.
|
|
20
20
|
|
|
@@ -25,20 +25,23 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
# install from
|
|
29
|
-
pip install
|
|
28
|
+
# install from the production repo
|
|
29
|
+
pip install git+ssh://git@github.com/Nimbleway/nimble-python.git
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
> [!NOTE]
|
|
33
|
+
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install nimble_python`
|
|
34
|
+
|
|
32
35
|
## Usage
|
|
33
36
|
|
|
34
37
|
The full API of this library can be found in [api.md](api.md).
|
|
35
38
|
|
|
36
39
|
```python
|
|
37
40
|
import os
|
|
38
|
-
from nimble_python import
|
|
41
|
+
from nimble_python import Nimbleway
|
|
39
42
|
|
|
40
|
-
client =
|
|
41
|
-
api_key=os.environ.get("
|
|
43
|
+
client = Nimbleway(
|
|
44
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
42
45
|
# defaults to "staging".
|
|
43
46
|
environment="production",
|
|
44
47
|
)
|
|
@@ -52,20 +55,20 @@ print(response.id)
|
|
|
52
55
|
|
|
53
56
|
While you can provide an `api_key` keyword argument,
|
|
54
57
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
55
|
-
to add `
|
|
58
|
+
to add `NIMBLE_API_KEY="My API Key"` to your `.env` file
|
|
56
59
|
so that your API Key is not stored in source control.
|
|
57
60
|
|
|
58
61
|
## Async usage
|
|
59
62
|
|
|
60
|
-
Simply import `
|
|
63
|
+
Simply import `AsyncNimbleway` instead of `Nimbleway` and use `await` with each API call:
|
|
61
64
|
|
|
62
65
|
```python
|
|
63
66
|
import os
|
|
64
67
|
import asyncio
|
|
65
|
-
from nimble_python import
|
|
68
|
+
from nimble_python import AsyncNimbleway
|
|
66
69
|
|
|
67
|
-
client =
|
|
68
|
-
api_key=os.environ.get("
|
|
70
|
+
client = AsyncNimbleway(
|
|
71
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
69
72
|
# defaults to "staging".
|
|
70
73
|
environment="production",
|
|
71
74
|
)
|
|
@@ -91,8 +94,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
|
|
|
91
94
|
You can enable this by installing `aiohttp`:
|
|
92
95
|
|
|
93
96
|
```sh
|
|
94
|
-
# install from
|
|
95
|
-
pip install nimble_python[aiohttp]
|
|
97
|
+
# install from the production repo
|
|
98
|
+
pip install 'nimble_python[aiohttp] @ git+ssh://git@github.com/Nimbleway/nimble-python.git'
|
|
96
99
|
```
|
|
97
100
|
|
|
98
101
|
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
@@ -101,12 +104,12 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
|
|
|
101
104
|
import os
|
|
102
105
|
import asyncio
|
|
103
106
|
from nimble_python import DefaultAioHttpClient
|
|
104
|
-
from nimble_python import
|
|
107
|
+
from nimble_python import AsyncNimbleway
|
|
105
108
|
|
|
106
109
|
|
|
107
110
|
async def main() -> None:
|
|
108
|
-
async with
|
|
109
|
-
api_key=os.environ.get("
|
|
111
|
+
async with AsyncNimbleway(
|
|
112
|
+
api_key=os.environ.get("NIMBLE_API_KEY"), # This is the default and can be omitted
|
|
110
113
|
http_client=DefaultAioHttpClient(),
|
|
111
114
|
) as client:
|
|
112
115
|
response = await client.extract(
|
|
@@ -133,9 +136,9 @@ Typed requests and responses provide autocomplete and documentation within your
|
|
|
133
136
|
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
134
137
|
|
|
135
138
|
```python
|
|
136
|
-
from nimble_python import
|
|
139
|
+
from nimble_python import Nimbleway
|
|
137
140
|
|
|
138
|
-
client =
|
|
141
|
+
client = Nimbleway()
|
|
139
142
|
|
|
140
143
|
response = client.extract(
|
|
141
144
|
debug_options={},
|
|
@@ -155,9 +158,9 @@ All errors inherit from `nimble_python.APIError`.
|
|
|
155
158
|
|
|
156
159
|
```python
|
|
157
160
|
import nimble_python
|
|
158
|
-
from nimble_python import
|
|
161
|
+
from nimble_python import Nimbleway
|
|
159
162
|
|
|
160
|
-
client =
|
|
163
|
+
client = Nimbleway()
|
|
161
164
|
|
|
162
165
|
try:
|
|
163
166
|
client.extract(
|
|
@@ -197,10 +200,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
|
197
200
|
You can use the `max_retries` option to configure or disable retry settings:
|
|
198
201
|
|
|
199
202
|
```python
|
|
200
|
-
from nimble_python import
|
|
203
|
+
from nimble_python import Nimbleway
|
|
201
204
|
|
|
202
205
|
# Configure the default for all requests:
|
|
203
|
-
client =
|
|
206
|
+
client = Nimbleway(
|
|
204
207
|
# default is 2
|
|
205
208
|
max_retries=0,
|
|
206
209
|
)
|
|
@@ -218,16 +221,16 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
|
218
221
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
219
222
|
|
|
220
223
|
```python
|
|
221
|
-
from nimble_python import
|
|
224
|
+
from nimble_python import Nimbleway
|
|
222
225
|
|
|
223
226
|
# Configure the default for all requests:
|
|
224
|
-
client =
|
|
227
|
+
client = Nimbleway(
|
|
225
228
|
# 20 seconds (default is 1 minute)
|
|
226
229
|
timeout=20.0,
|
|
227
230
|
)
|
|
228
231
|
|
|
229
232
|
# More granular control:
|
|
230
|
-
client =
|
|
233
|
+
client = Nimbleway(
|
|
231
234
|
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
|
|
232
235
|
)
|
|
233
236
|
|
|
@@ -248,10 +251,10 @@ Note that requests that time out are [retried twice by default](#retries).
|
|
|
248
251
|
|
|
249
252
|
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
|
|
250
253
|
|
|
251
|
-
You can enable logging by setting the environment variable `
|
|
254
|
+
You can enable logging by setting the environment variable `NIMBLEWAY_LOG` to `info`.
|
|
252
255
|
|
|
253
256
|
```shell
|
|
254
|
-
$ export
|
|
257
|
+
$ export NIMBLEWAY_LOG=info
|
|
255
258
|
```
|
|
256
259
|
|
|
257
260
|
Or to `debug` for more verbose logging.
|
|
@@ -273,9 +276,9 @@ if response.my_field is None:
|
|
|
273
276
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
|
274
277
|
|
|
275
278
|
```py
|
|
276
|
-
from nimble_python import
|
|
279
|
+
from nimble_python import Nimbleway
|
|
277
280
|
|
|
278
|
-
client =
|
|
281
|
+
client = Nimbleway()
|
|
279
282
|
response = client.with_raw_response.extract(
|
|
280
283
|
debug_options={},
|
|
281
284
|
url="https://example.com",
|
|
@@ -353,10 +356,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
|
353
356
|
|
|
354
357
|
```python
|
|
355
358
|
import httpx
|
|
356
|
-
from nimble_python import
|
|
359
|
+
from nimble_python import Nimbleway, DefaultHttpxClient
|
|
357
360
|
|
|
358
|
-
client =
|
|
359
|
-
# Or use the `
|
|
361
|
+
client = Nimbleway(
|
|
362
|
+
# Or use the `NIMBLEWAY_BASE_URL` env var
|
|
360
363
|
base_url="http://my.test.server.example.com:8083",
|
|
361
364
|
http_client=DefaultHttpxClient(
|
|
362
365
|
proxy="http://my.test.proxy.example.com",
|
|
@@ -376,9 +379,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
|
376
379
|
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.
|
|
377
380
|
|
|
378
381
|
```py
|
|
379
|
-
from nimble_python import
|
|
382
|
+
from nimble_python import Nimbleway
|
|
380
383
|
|
|
381
|
-
with
|
|
384
|
+
with Nimbleway() as client:
|
|
382
385
|
# make requests here
|
|
383
386
|
...
|
|
384
387
|
|
|
@@ -16,9 +16,9 @@ before making any information public.
|
|
|
16
16
|
## Reporting Non-SDK Related Security Issues
|
|
17
17
|
|
|
18
18
|
If you encounter security issues that are not directly related to SDKs but pertain to the services
|
|
19
|
-
or products provided by
|
|
19
|
+
or products provided by Nimbleway, please follow the respective company's security reporting guidelines.
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Nimbleway Terms and Policies
|
|
22
22
|
|
|
23
23
|
Please contact support@nimbleway.com for any questions or concerns regarding the security of our services.
|
|
24
24
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nimble_python"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "The official Python library for the
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "The official Python library for the nimbleway API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
authors = [
|
|
8
|
-
{ name = "
|
|
8
|
+
{ name = "Nimbleway", email = "support@nimbleway.com" },
|
|
9
9
|
]
|
|
10
10
|
|
|
11
11
|
dependencies = [
|
|
@@ -8,13 +8,13 @@ from ._utils import file_from_path
|
|
|
8
8
|
from ._client import (
|
|
9
9
|
ENVIRONMENTS,
|
|
10
10
|
Client,
|
|
11
|
-
Nimble,
|
|
12
11
|
Stream,
|
|
13
12
|
Timeout,
|
|
13
|
+
Nimbleway,
|
|
14
14
|
Transport,
|
|
15
15
|
AsyncClient,
|
|
16
|
-
AsyncNimble,
|
|
17
16
|
AsyncStream,
|
|
17
|
+
AsyncNimbleway,
|
|
18
18
|
RequestOptions,
|
|
19
19
|
)
|
|
20
20
|
from ._models import BaseModel
|
|
@@ -23,10 +23,10 @@ from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIR
|
|
|
23
23
|
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
|
|
24
24
|
from ._exceptions import (
|
|
25
25
|
APIError,
|
|
26
|
-
NimbleError,
|
|
27
26
|
ConflictError,
|
|
28
27
|
NotFoundError,
|
|
29
28
|
APIStatusError,
|
|
29
|
+
NimblewayError,
|
|
30
30
|
RateLimitError,
|
|
31
31
|
APITimeoutError,
|
|
32
32
|
BadRequestError,
|
|
@@ -52,7 +52,7 @@ __all__ = [
|
|
|
52
52
|
"not_given",
|
|
53
53
|
"Omit",
|
|
54
54
|
"omit",
|
|
55
|
-
"
|
|
55
|
+
"NimblewayError",
|
|
56
56
|
"APIError",
|
|
57
57
|
"APIStatusError",
|
|
58
58
|
"APITimeoutError",
|
|
@@ -72,8 +72,8 @@ __all__ = [
|
|
|
72
72
|
"AsyncClient",
|
|
73
73
|
"Stream",
|
|
74
74
|
"AsyncStream",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
75
|
+
"Nimbleway",
|
|
76
|
+
"AsyncNimbleway",
|
|
77
77
|
"ENVIRONMENTS",
|
|
78
78
|
"file_from_path",
|
|
79
79
|
"BaseModel",
|