SeedData Python SDK
SeedData is a Python client SDK for accessing SeedData market data services.
This package only contains the client SDK. The server-side gateway and worker components are not included in this PyPI distribution.
Installation
pip install seeddata-quant
Quick Start
import seeddata as sd
sd.set_token("YOUR_TOKEN")
result = sd.query("SELECT * FROM trade_date LIMIT 5")
print(result.df)
Common APIs
import seeddata as sd
sd.set_token("YOUR_TOKEN")
df = sd.get_klines(
instruments=["000001.SZ"],
fields=["close"],
start_time="2024-01-01",
end_time="2024-01-31",
period="1d",
adjust="none",
market_type="cn_stock",
)
realtime_1min = sd.query(
"SELECT * FROM cn_stock_1min_realtime_data "
"LATEST ON trade_time PARTITION BY ts_code LIMIT 20"
).df
Trading Calendars
seeddata.calendars provides trading-calendar helpers. It is pure client-side
(no network calls): it reuses pandas_market_calendars for A-share / HK / US
equities and ships a packaged parquet for China futures.
import seeddata.calendars as cal
cal.get_calendar_names() # supported MIC names
c = cal.get_calendar("XNYS") # NYSE-listed ordinary equities
c.valid_days("2026-06-01", "2026-06-30") # trading days in range
c.is_valid_day("2026-06-19") # False (Juneteenth)
c.date_to_valid_day("2026-06-06", direction="next") # next trading day
c.valid_days_window("2026-06-02", 5) # 5 trading days forward
c.schedule("2026-11-27") # regular session, 09:30-13:00 ET
c.schedule("2026-11-27", session="extended") # pre/open/close/post
c.schedule("2026-06-01", session="extended", tz="Asia/Shanghai")
c.early_closes("2026-01-01", "2026-12-31")
c.is_open_at("2026-06-01 22:00:00+08:00", session="regular")
Supported MICs: CCFX GFEX XDCE XHKG XINE XNAS XNYS XSGE XSHE XSHG XZCE CN_FUTURES.
China futures (CCFX/XDCE/XZCE/XSGE/XINE/GFEX) and CN_FUTURES (their union)
are backed by packaged data. A-share / HK / US calendars use
pandas_market_calendars; XNYS and XNAS map to its NYSE and NASDAQ
ordinary-equity rules. Names are ISO 10383 MIC only. Returns default to each
market's local timezone. US calendars additionally provide regular/extended
schedule(), early_closes(), late_opens(), and is_open_at(); China-futures
schedule() raises NotImplementedError.
Token
Public SeedData gateways require a token:
sd.set_token("YOUR_TOKEN")
You can also set the token through an environment variable:
export SEEDDATA_TOKEN="YOUR_TOKEN"
Private deployments may allow anonymous local access. In that case the SDK can
send requests without sd.set_token(...); the server decides whether anonymous
requests are allowed.
Base URL
By default, the SDK configures only the public history gateway:
- history:
https://history.seeddata.cn - realtime: not configured until the public realtime service is deployed
Realtime calls fail locally with a configuration error until an address is set explicitly.
For local development or private deployments, configure the gateways in code:
sd.set_base_url(
history="http://127.0.0.1:28637",
realtime="http://127.0.0.1:28637",
)
You can set only one side if needed:
sd.set_base_url(history="http://127.0.0.1:28637")
sd.set_base_url(realtime="http://127.0.0.1:28637")
Missing arguments keep their current values. Trailing slashes are removed, and empty values raise an error. This function only configures request URLs and does not check network connectivity.
License
This package is proprietary software. Installation and use require authorization from SeedData.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seeddata_quant-1.0.4-py3-none-any.whl.
File metadata
- Download URL: seeddata_quant-1.0.4-py3-none-any.whl
- Upload date:
- Size: 110.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3981b31cba26a9c1b71b238de93a4e0862a154c3eed859dbfd27e4c70f80d163
|
|
| MD5 |
71bebc563d128870cec95ced29726375
|
|
| BLAKE2b-256 |
a419cba784202367254143067805fbd416e06c76fc14acb0b07107e3c7b9b4ce
|