dataquery-sdk 0.2.0__tar.gz → 1.0.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.
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/CHANGELOG.md +5 -1
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/CONTRIBUTING.md +1 -1
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/PKG-INFO +186 -59
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/README.md +177 -55
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/__init__.py +1 -1
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/sse/client.py +6 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/transport/auth.py +5 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/types/models.py +1 -1
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/utils.py +6 -7
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/PKG-INFO +186 -59
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/requires.txt +6 -1
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/pyproject.toml +11 -6
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/LICENSE +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/MANIFEST.in +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/cli.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/config/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/config/env.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/config/logging.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/constants/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/constants/api.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/constants/download.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/constants/rate_limit.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/constants/sse.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/core/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/core/_mixins.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/core/client.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/dataquery.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/download/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/download/parallel.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/download/utils.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/py.typed +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/sse/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/sse/event_store.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/sse/subscriber.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/transport/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/transport/connection_pool.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/transport/rate_limiter.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/transport/retry.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/types/__init__.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery/types/exceptions.py +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/SOURCES.txt +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/dependency_links.txt +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/entry_points.txt +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/dataquery_sdk.egg-info/top_level.txt +0 -0
- {dataquery_sdk-0.2.0 → dataquery_sdk-1.0.0}/setup.cfg +0 -0
|
@@ -29,4 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
29
|
- Introduced file-group-id to the group downloads
|
|
30
30
|
## [0.2.0] - 2026-05-06
|
|
31
31
|
- SSE auto-download with cross-process event replay and multi-group support
|
|
32
|
-
- Python 3.11+ only
|
|
32
|
+
- Python 3.11+ only
|
|
33
|
+
## [1.0.0] - 2026-06-03
|
|
34
|
+
- Stable 1.0 release
|
|
35
|
+
- Bumped minimum Python to 3.12; added 3.14 to test matrix
|
|
36
|
+
- Security floors: idna>=3.15, urllib3>=2.7.0, pymdown-extensions>=10.21.3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dataquery-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Python SDK for DATAQUERY Data API - Query, download, and check availability of economic data files
|
|
5
5
|
Author-email: DATAQUERY SDK Team <dataquery_support@jpmorgan.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/dataquery/dataquery-sdk
|
|
@@ -15,20 +15,21 @@ Classifier: Intended Audience :: Science/Research
|
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
22
|
Classifier: Topic :: Office/Business :: Financial
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
24
24
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
25
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.12
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
License-File: LICENSE
|
|
28
|
-
Requires-Dist: aiohttp<4.0.0,>=3.
|
|
28
|
+
Requires-Dist: aiohttp<4.0.0,>=3.10.11
|
|
29
29
|
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
30
30
|
Requires-Dist: structlog>=23.0.0
|
|
31
31
|
Requires-Dist: python-dotenv>=1.0.0
|
|
32
|
+
Requires-Dist: idna>=3.15
|
|
32
33
|
Provides-Extra: dev
|
|
33
34
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
34
35
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
@@ -39,11 +40,13 @@ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
|
39
40
|
Requires-Dist: pip-audit>=2.7.0; extra == "dev"
|
|
40
41
|
Requires-Dist: build>=1.3.0; extra == "dev"
|
|
41
42
|
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
43
|
+
Requires-Dist: urllib3>=2.7.0; extra == "dev"
|
|
42
44
|
Provides-Extra: docs
|
|
43
45
|
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
44
46
|
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
45
47
|
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == "docs"
|
|
46
48
|
Requires-Dist: mike>=1.1.0; extra == "docs"
|
|
49
|
+
Requires-Dist: pymdown-extensions>=10.21.3; extra == "docs"
|
|
47
50
|
Provides-Extra: pandas
|
|
48
51
|
Requires-Dist: pandas>=2.0.0; extra == "pandas"
|
|
49
52
|
Provides-Extra: all
|
|
@@ -60,24 +63,37 @@ Requires-Dist: mike>=1.1.0; extra == "all"
|
|
|
60
63
|
Requires-Dist: pandas>=2.0.0; extra == "all"
|
|
61
64
|
Requires-Dist: pip-audit>=2.7.0; extra == "all"
|
|
62
65
|
Requires-Dist: build>=1.3.0; extra == "all"
|
|
66
|
+
Requires-Dist: urllib3>=2.7.0; extra == "all"
|
|
67
|
+
Requires-Dist: pymdown-extensions>=10.21.3; extra == "all"
|
|
63
68
|
Dynamic: license-file
|
|
64
69
|
|
|
65
70
|
# DataQuery SDK
|
|
66
71
|
|
|
67
|
-
Python SDK for the J.P. Morgan DataQuery API
|
|
72
|
+
Python SDK for the J.P. Morgan DataQuery API. The SDK wraps two distinct
|
|
73
|
+
surfaces behind one client:
|
|
68
74
|
|
|
69
|
-
|
|
75
|
+
- **File Delivery API** — list, check availability of, and download files
|
|
76
|
+
(single, date-range, historical backfill, or live via SSE notifications).
|
|
77
|
+
- **JSON Data API** — discover groups/instruments and run
|
|
78
|
+
time-series, grid, and attribute queries that return JSON.
|
|
79
|
+
|
|
80
|
+
OAuth 2.0, token-bucket rate limiting, retries, and a circuit breaker are
|
|
81
|
+
built in for both.
|
|
82
|
+
|
|
83
|
+
[](https://www.python.org/downloads/)
|
|
70
84
|
[](https://opensource.org/licenses/MIT)
|
|
71
85
|
[](https://github.com/astral-sh/ruff)
|
|
72
86
|
|
|
73
87
|
## Contents
|
|
74
88
|
|
|
89
|
+
- [The two APIs at a glance](#the-two-apis-at-a-glance)
|
|
75
90
|
- [Features](#features)
|
|
76
91
|
- [New here? Three steps to your first download](#new-here-three-steps-to-your-first-download)
|
|
77
92
|
- [Installation](#installation)
|
|
78
93
|
- [Configure credentials](#configure-credentials)
|
|
79
|
-
- [Quick start](#quick-start)
|
|
80
|
-
- [
|
|
94
|
+
- [Quick start — File Delivery API](#quick-start--file-delivery-api)
|
|
95
|
+
- [Quick start — JSON Data API](#quick-start--json-data-api)
|
|
96
|
+
- [Auto-download (SSE)](#auto-download-sse)
|
|
81
97
|
- [CLI](#cli)
|
|
82
98
|
- [Configuration](#configuration)
|
|
83
99
|
- [Logging](#logging)
|
|
@@ -88,17 +104,38 @@ Python SDK for the J.P. Morgan DataQuery API — authenticated file downloads, t
|
|
|
88
104
|
- [API reference (most-used methods)](#api-reference-most-used-methods)
|
|
89
105
|
- [Examples](#examples) · [Development](#development) · [Requirements](#requirements) · [Support](#support)
|
|
90
106
|
|
|
107
|
+
## The two APIs at a glance
|
|
108
|
+
|
|
109
|
+
| | **File Delivery API** | **JSON Data API** |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| **What you get** | Binary file payloads (CSV, Parquet, etc.) streamed to disk | JSON responses for catalog metadata and time-series data |
|
|
112
|
+
| **Typical methods** | `download_file_async`, `run_group_download_async`, `download_historical_async`, `auto_download_async`, `list_files_async`, `list_available_files_async`, `check_availability_async` | `list_groups_async`, `search_groups_async`, `list_instruments_async`, `search_instruments_async`, `get_group_attributes_async`, `get_group_filters_async`, `get_expressions_time_series_async`, `get_instrument_time_series_async`, `get_group_time_series_async`, `get_grid_data_async` |
|
|
113
|
+
| **CLI surface** | `dataquery files`, `availability`, `download`, `download-group` | `dataquery groups` |
|
|
114
|
+
|
|
115
|
+
Both surfaces share the same host and the same OAuth credentials, and run
|
|
116
|
+
through one `DataQuery` client — pick the methods that match what you need.
|
|
117
|
+
|
|
91
118
|
## Features
|
|
92
119
|
|
|
120
|
+
**File Delivery API**
|
|
121
|
+
|
|
93
122
|
- **Streaming file downloads** — single streaming GET per file
|
|
94
|
-
- **
|
|
123
|
+
- **Date-range and historical downloads** — fetch every file in a group (optionally filtered to one or many `file-group-id`s) between two dates, or chunk a long historical backfill into monthly ranges
|
|
95
124
|
- **Notification-driven downloads (SSE)** — subscribe to the `/events/notification` stream and auto-download files as soon as they are published
|
|
125
|
+
|
|
126
|
+
**JSON Data API**
|
|
127
|
+
|
|
128
|
+
- **Group, file, and instrument discovery** — list and keyword-search the catalog
|
|
96
129
|
- **Time-series queries** — by expression, by instrument, or by group with attribute / filter projections
|
|
130
|
+
- **Grid data** — pivoted grid queries for tabular responses
|
|
131
|
+
- **Optional pandas integration** — `to_dataframe(...)` converts any JSON response
|
|
132
|
+
|
|
133
|
+
**Cross-cutting**
|
|
134
|
+
|
|
97
135
|
- **OAuth 2.0 with token caching and refresh** — or supply a bearer token directly
|
|
98
136
|
- **Token-bucket rate limiter** — 300 rpm / 5 tps defaults (configurable up to API limits)
|
|
99
137
|
- **Retry + circuit breaker** — exponential backoff, configurable failure threshold
|
|
100
138
|
- **Sync and async APIs** — every operation has `_async` and sync variants
|
|
101
|
-
- **Optional pandas integration** — `to_dataframe(...)` on any response
|
|
102
139
|
- **CLI** — `dataquery groups | files | availability | download | download-group | auth | config`
|
|
103
140
|
|
|
104
141
|
## New here? Three steps to your first download
|
|
@@ -136,7 +173,7 @@ pip install "dataquery-sdk[pandas]"
|
|
|
136
173
|
pip install "dataquery-sdk[dev]"
|
|
137
174
|
```
|
|
138
175
|
|
|
139
|
-
Python 3.
|
|
176
|
+
Python 3.12+ is required.
|
|
140
177
|
|
|
141
178
|
## Configure credentials
|
|
142
179
|
|
|
@@ -164,7 +201,9 @@ dq = DataQuery(client_id="...", client_secret="...")
|
|
|
164
201
|
|
|
165
202
|
A starter `.env` can be generated with `dataquery config template --output .env`.
|
|
166
203
|
|
|
167
|
-
## Quick start
|
|
204
|
+
## Quick start — File Delivery API
|
|
205
|
+
|
|
206
|
+
These methods stream binary file payloads to disk.
|
|
168
207
|
|
|
169
208
|
### Download files for a date range
|
|
170
209
|
|
|
@@ -223,6 +262,40 @@ async with DataQuery() as dq:
|
|
|
223
262
|
print(f"Downloaded: {result.local_path} ({result.file_size} bytes)")
|
|
224
263
|
```
|
|
225
264
|
|
|
265
|
+
### List files / check availability
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
async with DataQuery() as dq:
|
|
269
|
+
files = await dq.list_files_async(group_id="JPMAQS_GENERIC_RETURNS")
|
|
270
|
+
available = await dq.list_available_files_async(
|
|
271
|
+
group_id="JPMAQS_GENERIC_RETURNS",
|
|
272
|
+
start_date="20250101",
|
|
273
|
+
end_date="20250131",
|
|
274
|
+
)
|
|
275
|
+
info = await dq.check_availability_async(
|
|
276
|
+
file_group_id="JPMAQS_GENERIC_RETURNS",
|
|
277
|
+
file_datetime="20250115",
|
|
278
|
+
)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
For live notification-driven downloads, see [Auto-download (SSE)](#auto-download-sse).
|
|
282
|
+
|
|
283
|
+
## Quick start — JSON Data API
|
|
284
|
+
|
|
285
|
+
These methods return JSON (Pydantic-typed) responses. Use `to_dataframe(...)`
|
|
286
|
+
to convert any response to a pandas DataFrame.
|
|
287
|
+
|
|
288
|
+
### Discover groups and instruments
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
async with DataQuery() as dq:
|
|
292
|
+
groups = await dq.list_groups_async(limit=100)
|
|
293
|
+
matches = await dq.search_groups_async("fixed income", limit=20)
|
|
294
|
+
instruments = await dq.search_instruments_async(
|
|
295
|
+
group_id="FI_GO_BO_EA", keywords="irish",
|
|
296
|
+
)
|
|
297
|
+
```
|
|
298
|
+
|
|
226
299
|
### Time-series queries
|
|
227
300
|
|
|
228
301
|
```python
|
|
@@ -234,6 +307,14 @@ async with DataQuery() as dq:
|
|
|
234
307
|
end_date="20240131",
|
|
235
308
|
)
|
|
236
309
|
|
|
310
|
+
# By instrument + attribute
|
|
311
|
+
ts = await dq.get_instrument_time_series_async(
|
|
312
|
+
instruments=["IE00BH3SQ895"],
|
|
313
|
+
attributes=["MIDPRC"],
|
|
314
|
+
start_date="20240101",
|
|
315
|
+
end_date="20240131",
|
|
316
|
+
)
|
|
317
|
+
|
|
237
318
|
# By group with attributes + filter
|
|
238
319
|
ts = await dq.get_group_time_series_async(
|
|
239
320
|
group_id="FI_GO_BO_EA",
|
|
@@ -246,28 +327,71 @@ async with DataQuery() as dq:
|
|
|
246
327
|
df = dq.to_dataframe(ts) # requires pandas extra
|
|
247
328
|
```
|
|
248
329
|
|
|
249
|
-
###
|
|
330
|
+
### Group metadata (attributes, filters)
|
|
250
331
|
|
|
251
332
|
```python
|
|
252
333
|
async with DataQuery() as dq:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
334
|
+
attrs = await dq.get_group_attributes_async(group_id="FI_GO_BO_EA")
|
|
335
|
+
filters = await dq.get_group_filters_async(group_id="FI_GO_BO_EA")
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Grid data
|
|
339
|
+
|
|
340
|
+
```python
|
|
341
|
+
async with DataQuery() as dq:
|
|
342
|
+
grid = await dq.get_grid_data_async(
|
|
343
|
+
expr="DB(GRID,...)", # provider-supplied grid expression
|
|
344
|
+
date="20240131",
|
|
262
345
|
)
|
|
263
346
|
```
|
|
264
347
|
|
|
265
|
-
## Auto-download (
|
|
348
|
+
## Auto-download (SSE)
|
|
266
349
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
350
|
+
`auto_download_async` subscribes to the DataQuery `/events/notification` SSE
|
|
351
|
+
stream and downloads files as soon as the server announces them — no polling.
|
|
352
|
+
The call returns immediately with a manager object; the subscription runs in
|
|
353
|
+
the background until you call `manager.stop()`.
|
|
354
|
+
|
|
355
|
+
```python
|
|
356
|
+
import asyncio
|
|
357
|
+
from dataquery import DataQuery
|
|
358
|
+
|
|
359
|
+
async def main():
|
|
360
|
+
async with DataQuery() as dq:
|
|
361
|
+
manager = await dq.auto_download_async(
|
|
362
|
+
group_id="JPMAQS_GENERIC_RETURNS",
|
|
363
|
+
destination_dir="./downloads",
|
|
364
|
+
file_group_id=["FG_ABC", "FG_DEF"], # optional server-side filter
|
|
365
|
+
)
|
|
366
|
+
try:
|
|
367
|
+
while True:
|
|
368
|
+
await asyncio.sleep(60)
|
|
369
|
+
except KeyboardInterrupt:
|
|
370
|
+
await manager.stop()
|
|
371
|
+
print(manager.get_stats())
|
|
372
|
+
|
|
373
|
+
asyncio.run(main())
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Key behaviours:
|
|
377
|
+
|
|
378
|
+
- **Initial backfill** (`initial_check=True`, default) — on startup, checks
|
|
379
|
+
availability for the current day so files published before the subscription
|
|
380
|
+
started are not missed.
|
|
381
|
+
- **Cross-process event replay** (`enable_event_replay=True`, default) — the
|
|
382
|
+
last SSE event id is persisted to
|
|
383
|
+
`<destination>/.sse_state/sse_<fingerprint>.json`, so a restart resumes from
|
|
384
|
+
where the previous session stopped rather than replaying from scratch.
|
|
385
|
+
- **Reconnects** — exponential backoff between `reconnect_delay` (5s) and
|
|
386
|
+
`max_reconnect_delay` (60s). Set `heartbeat_timeout` (e.g. `90.0`) to force
|
|
387
|
+
a reconnect when no bytes arrive within the window — useful behind stateful
|
|
388
|
+
middleboxes that drop idle sockets.
|
|
389
|
+
- **Health stats** — `manager.get_stats()` returns notifications received,
|
|
390
|
+
files downloaded / skipped / failed, the last event id, and a bounded ring
|
|
391
|
+
of recent errors.
|
|
392
|
+
|
|
393
|
+
The same path is available from the CLI as `dataquery download --watch` (see
|
|
394
|
+
below).
|
|
271
395
|
|
|
272
396
|
## CLI
|
|
273
397
|
|
|
@@ -330,14 +454,6 @@ All environment variables use the `DATAQUERY_` prefix.
|
|
|
330
454
|
| `DATAQUERY_BEARER_TOKEN` | _(none)_ | Alternative to OAuth |
|
|
331
455
|
| `DATAQUERY_OAUTH_ENABLED` | `true` | Set `false` to use bearer-token mode |
|
|
332
456
|
|
|
333
|
-
**API endpoints**
|
|
334
|
-
|
|
335
|
-
| Variable | Default |
|
|
336
|
-
|---|---|
|
|
337
|
-
| `DATAQUERY_BASE_URL` | `https://api-developer.jpmorgan.com` |
|
|
338
|
-
| `DATAQUERY_FILES_BASE_URL` | `https://api-dataquery.jpmchase.com` |
|
|
339
|
-
| `DATAQUERY_CONTEXT_PATH` | `/research/dataquery-authe/api/v2` |
|
|
340
|
-
|
|
341
457
|
**HTTP / retry / rate limit**
|
|
342
458
|
|
|
343
459
|
| Variable | Default |
|
|
@@ -364,7 +480,6 @@ from dataquery import ClientConfig, DataQuery
|
|
|
364
480
|
config = ClientConfig(
|
|
365
481
|
client_id="...",
|
|
366
482
|
client_secret="...",
|
|
367
|
-
base_url="https://api-developer.jpmorgan.com",
|
|
368
483
|
timeout=60.0,
|
|
369
484
|
max_retries=3,
|
|
370
485
|
requests_per_minute=300,
|
|
@@ -536,28 +651,40 @@ flags.
|
|
|
536
651
|
|
|
537
652
|
## API reference (most-used methods)
|
|
538
653
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
|
542
|
-
|
|
543
|
-
|
|
|
544
|
-
|
|
|
545
|
-
|
|
|
546
|
-
|
|
|
547
|
-
|
|
|
548
|
-
|
|
|
549
|
-
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
|
554
|
-
|
|
555
|
-
|
|
|
556
|
-
|
|
|
557
|
-
|
|
|
558
|
-
|
|
|
559
|
-
|
|
|
560
|
-
|
|
|
654
|
+
### File Delivery API
|
|
655
|
+
|
|
656
|
+
| Method | Notes |
|
|
657
|
+
|---|---|
|
|
658
|
+
| `list_files_async(group_id, file_group_id=None)` | List files in a group |
|
|
659
|
+
| `list_available_files_async(group_id, file_group_id, start_date, end_date)` | Files available in a date range |
|
|
660
|
+
| `check_availability_async(file_group_id, file_datetime)` | Per-file availability check |
|
|
661
|
+
| `download_file_async(file_group_id, file_datetime, ...)` | Single-file streaming download |
|
|
662
|
+
| `run_group_download_async(group_id, start_date, end_date, file_group_id=None, ...)` | Date-range download, single or list of ids |
|
|
663
|
+
| `download_historical_async(...)` | Chunked historical backfill (monthly ranges) |
|
|
664
|
+
| `auto_download_async(group_id, ...)` | SSE notification subscription (the only watch path) |
|
|
665
|
+
|
|
666
|
+
### JSON Data API
|
|
667
|
+
|
|
668
|
+
| Method | Notes |
|
|
669
|
+
|---|---|
|
|
670
|
+
| `list_groups_async(limit)` | List groups |
|
|
671
|
+
| `search_groups_async(keywords, limit, offset)` | Keyword search |
|
|
672
|
+
| `list_instruments_async(group_id, instrument_id=None, page=None)` | List / lookup instruments |
|
|
673
|
+
| `search_instruments_async(group_id, keywords, page=None)` | Instrument keyword search |
|
|
674
|
+
| `get_group_attributes_async(group_id, ...)` | Available attributes for a group |
|
|
675
|
+
| `get_group_filters_async(group_id, page=None)` | Available filters for a group |
|
|
676
|
+
| `get_expressions_time_series_async(expressions, start_date, end_date)` | Time series by expression |
|
|
677
|
+
| `get_instrument_time_series_async(instruments, attributes, start_date, end_date)` | Time series by instrument + attribute |
|
|
678
|
+
| `get_group_time_series_async(group_id, attributes, filter, start_date, end_date)` | Time series for a group |
|
|
679
|
+
| `get_grid_data_async(expr=None, grid_id=None, date=None)` | Grid (pivoted) data |
|
|
680
|
+
|
|
681
|
+
### Utilities (shared)
|
|
682
|
+
|
|
683
|
+
| Method | Notes |
|
|
684
|
+
|---|---|
|
|
685
|
+
| `health_check_async()` | API heartbeat |
|
|
686
|
+
| `to_dataframe(response)` | Requires `pandas` extra |
|
|
687
|
+
| `get_stats()` / `get_pool_stats()` / `get_rate_limit_info()` | Diagnostics |
|
|
561
688
|
|
|
562
689
|
Every async method has a sync counterpart with the same name minus the
|
|
563
690
|
`_async` suffix — `list_groups_async` ↔ `list_groups`, `download_file_async` ↔
|
|
@@ -609,7 +736,7 @@ Pytest markers: `slow`, `integration`, `unit`, `asyncio`.
|
|
|
609
736
|
|
|
610
737
|
## Requirements
|
|
611
738
|
|
|
612
|
-
- Python 3.
|
|
739
|
+
- Python 3.12+
|
|
613
740
|
- `aiohttp>=3.8,<4`, `pydantic>=2,<3`, `structlog>=23`, `python-dotenv>=1`
|
|
614
741
|
- Optional: `pandas>=2` (for `to_dataframe`)
|
|
615
742
|
|