drip-exchange-klines
OKX 和 Bitget 的公开 REST K 线适配器。包本身不依赖 CCXT,不读取交易账户凭据,也不包含调度或数据库写入逻辑。
pip install drip-exchange-klines
from drip_exchange_klines import create_adapter
adapter = create_adapter("okx", "swap")
try:
bars = adapter.fetch_page(
symbol="BTCUSDT",
exchange_symbol="BTC-USDT-SWAP",
timeframe="5m",
since_ms=0,
until_ms=600_000,
limit=300,
)
finally:
adapter.close()
适配器统一输出 exchange、market_type、symbol、exchange_symbol、timeframe、ts、open、high、low、close、volume 和 confirm。ts 是 UTC 毫秒开盘时间戳,volume 是基础资产成交量。
proxy_url 是可选参数。未传入时不会设置 HTTP/HTTPS 代理,也不会读取系统代理;需要代理时显式传入 create_adapter(..., proxy_url="http://127.0.0.1:10808")。
支持的交易所为 okx 和 bitget,市场类型为 spot 和 swap。该包只调用无需鉴权的行情 REST API;各交易所的可查询历史范围、频率限制和 K 线粒度以其官方文档为准:OKX、Bitget 现货、Bitget 合约。
Metadata
Release files for drip-exchange-klines 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drip_exchange_klines-0.3.0.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drip_exchange_klines-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / drip_exchange_klines-0.3.0.tar.gz
| Download URL | drip_exchange_klines-0.3.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee9395adc0024d828ffd197ba01d9fabecfe55fdeab657ff7e6c8a49090ea2ca
|
|
BLAKE2b-256 checksum How to use checksums |
d9a6fb93fd0a990d231a42600a946913689b022c0304371ab6e8428f38206b2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / drip_exchange_klines-0.3.0-py3-none-any.whl
| Download URL | drip_exchange_klines-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54e5dce45f0a21a7a6b4686ce55b22f441817b79f3051863812d0a0845995bec
|
|
BLAKE2b-256 checksum How to use checksums |
a8539a1faa7c20b113a88a9d17e884800d5f1c9a6c61511437fee387f2266e11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|