You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***api:** api update ([ebee3a7](https://github.com/cryptechdev/neptune-api-v2-python/commit/ebee3a79f42790d9fba6fced90848e432581817f))
12
+
***api:** api update ([a2daaa3](https://github.com/cryptechdev/neptune-api-v2-python/commit/a2daaa306f5c0ea3c17d2816d25ab9eaf90f058c))
13
+
***api:** api update ([64bfdf0](https://github.com/cryptechdev/neptune-api-v2-python/commit/64bfdf0f0f702d71e05b37a490f1ced871af27d0))
14
+
***api:** disable series pagn, update example requests ([9d71f0b](https://github.com/cryptechdev/neptune-api-v2-python/commit/9d71f0b3d797212151cb8d65c5ff72886904a6e9))
15
+
***api:** Fix readme title, fix inverted example params ([c90715f](https://github.com/cryptechdev/neptune-api-v2-python/commit/c90715f3ad82baedeb47f32889d7aba4404d5114))
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -80,8 +83,11 @@ async def main() -> None:
80
83
asyncwith AsyncNeptuneAPIV2(
81
84
http_client=DefaultAioHttpClient(),
82
85
) as client:
83
-
response =await client.status.check_health()
84
-
print(response.status)
86
+
response =await client.markets.get_overview(
87
+
with_text=True,
88
+
with_value=True,
89
+
)
90
+
print(response.data)
85
91
86
92
87
93
asyncio.run(main())
@@ -96,6 +102,77 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
96
102
97
103
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
98
104
105
+
## Pagination
106
+
107
+
List methods in the Neptune API V2 API are paginated.
108
+
109
+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `neptune_api_v2.APIConnectionError` is raised.
@@ -112,7 +189,7 @@ from neptune_api_v2 import NeptuneAPIV2
112
189
client = NeptuneAPIV2()
113
190
114
191
try:
115
-
client.status.check_health()
192
+
client.markets.get_overview()
116
193
except neptune_api_v2.APIConnectionError as e:
117
194
print("The server could not be reached")
118
195
print(e.__cause__) # an underlying Exception, likely raised within httpx.
status= response.parse() # get the object that `status.check_health()` would have returned
226
-
print(status.status)
302
+
market= response.parse() # get the object that `markets.get_overview()` would have returned
303
+
print(market.data)
227
304
```
228
305
229
306
These methods return an [`APIResponse`](https://github.com/cryptechdev/neptune-api-v2-python/tree/main/src/neptune_api_v2/_response.py) object.
@@ -237,7 +314,7 @@ The above interface eagerly reads the full response body when you make the reque
237
314
To 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.
238
315
239
316
```python
240
-
with client.status.with_streaming_response.check_health() as response:
317
+
with client.markets.with_streaming_response.get_overview() as response:
0 commit comments