sparkdata 0.0.1__py3-none-any.whl
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.
sparkdata/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""SparkData — Python client for A-share market data API.
|
|
2
|
+
|
|
3
|
+
Status: **placeholder release (0.0.1)** — the client is under development.
|
|
4
|
+
|
|
5
|
+
Until the Python client ships, use the HTTP API directly:
|
|
6
|
+
|
|
7
|
+
https://www.spark-data.cn/api-reference
|
|
8
|
+
|
|
9
|
+
Public endpoints (no API key required):
|
|
10
|
+
|
|
11
|
+
GET https://www.spark-data.cn/v1/public/klines/daily?symbol=XSHG:000001
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
__version__ = "0.0.1"
|
|
16
|
+
__all__ = ["__version__"]
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sparkdata
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python client for SparkData (A-share market data API) — placeholder release
|
|
5
|
+
Project-URL: Homepage, https://www.spark-data.cn
|
|
6
|
+
Project-URL: Documentation, https://www.spark-data.cn/api-reference
|
|
7
|
+
Project-URL: Repository, https://www.spark-data.cn
|
|
8
|
+
Author-email: "Hangzhou Zhiyuan Xinghuo Technology Co., Ltd." <service@spark-data.cn>
|
|
9
|
+
License: Proprietary
|
|
10
|
+
Keywords: a-share,api,finance,market-data,quant
|
|
11
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# sparkdata
|
|
18
|
+
|
|
19
|
+
Python client for **SparkData**(智元星火数据平台)— A-share market data API.
|
|
20
|
+
|
|
21
|
+
> **Status: placeholder release (`0.0.1`).** The Python client is under development.
|
|
22
|
+
> The package name is reserved; the first working release will be `0.1.0`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Meanwhile, use the HTTP API directly
|
|
27
|
+
|
|
28
|
+
Public endpoint (no API key required):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl "https://www.spark-data.cn/v1/public/klines/daily?symbol=XSHG:000001"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Python (standard library only):
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
import json, urllib.request
|
|
38
|
+
|
|
39
|
+
url = "https://www.spark-data.cn/v1/public/klines/daily?symbol=XSHG:000001"
|
|
40
|
+
with urllib.request.urlopen(url, timeout=15) as r:
|
|
41
|
+
data = json.load(r)["data"]["snapshot"]["bars"]
|
|
42
|
+
|
|
43
|
+
print(len(data), data[-1]["trading_date"], data[-1]["close"])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Full documentation: <https://www.spark-data.cn/api-reference>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Planned API (draft)
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from sparkdata import Client
|
|
54
|
+
|
|
55
|
+
c = Client(api_key="spk_...") # or SPARKDATA_API_KEY env var
|
|
56
|
+
bars = c.klines_daily("XSHG:000001") # list[dict]
|
|
57
|
+
df = c.klines_daily("XSHG:000001").to_dataframe() # optional, needs pandas
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Planned scope for `0.1.0`:
|
|
61
|
+
|
|
62
|
+
- `Client(api_key=...)`, reads `SPARKDATA_API_KEY`
|
|
63
|
+
- `public_klines_daily()` — no key needed
|
|
64
|
+
- `klines_daily()` — authenticated
|
|
65
|
+
- typed errors: `AuthError` / `RateLimitError` / `InvalidParameterError` / `ServerError`
|
|
66
|
+
- automatic retry on `429` / `5xx` with backoff
|
|
67
|
+
- no hard dependency on pandas
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Links
|
|
72
|
+
|
|
73
|
+
- Website: <https://www.spark-data.cn>
|
|
74
|
+
- API reference: <https://www.spark-data.cn/api-reference>
|
|
75
|
+
- Terms: <https://www.spark-data.cn/legal/terms>
|
|
76
|
+
- Contact: service@spark-data.cn
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
© 2026 杭州智元星火科技有限公司 · SparkData数据平台
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
sparkdata/__init__.py,sha256=WYuXMtXEVDYcg8TD_otL6nKCKJ4sgmyeiQ_twZGA9Zw,414
|
|
2
|
+
sparkdata-0.0.1.dist-info/METADATA,sha256=QOV_daEvAFkZQdkIaAHjarfyMyTnSYmBBgdO4sEWYnA,2386
|
|
3
|
+
sparkdata-0.0.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
4
|
+
sparkdata-0.0.1.dist-info/RECORD,,
|