Core library for stock/crypto data with multi-source failover
Project description
open-stock-data
Core library for stock/crypto data with multi-source failover.
Provides 42 tool functions for A-stock, HK, US stock, and crypto data with automatic failover across 6 data sources.
Install
pip install open-stock-data
Usage
from open_stock_data.tools import stock_prices, get_current_time
# Get stock prices
print(stock_prices(symbol="600519", market="sh", limit=5))
# Get current time
print(get_current_time())
Environment Variables
| Variable | Purpose |
|---|---|
TUSHARE_TOKEN |
Tushare API token (enables Priority 0 A-share source) |
ALPHA_VANTAGE_API_KEY |
Alpha Vantage API key (enables Priority 4 US stock data) |
OKX_BASE_URL |
Custom OKX API proxy endpoint |
BINANCE_BASE_URL |
Custom Binance API proxy endpoint |
NEWSNOW_CHANNELS |
Comma-separated news source channels |
LOG_LEVEL |
Logging level (default: INFO) |
Available Tools
A-Stock (价格行情)
stock_prices— 个股K线数据stock_realtime— 个股实时行情stock_batch_realtime— 批量实时行情
A-Stock (信息查询)
search— 股票搜索stock_info— 个股基本信息stock_indicators— 财务指标摘要get_current_time— 当前时间与交易日历
A-Stock (市场资金)
stock_lhb_ggtj_sina— 龙虎榜stock_sector_fund_flow_rank— 板块资金流排名stock_margin_trading— 融资融券stock_zt_pool— 涨停池stock_north_flow— 北向资金stock_block_trade— 大宗交易stock_holder_num— 股东人数
A-Stock (个股分析)
stock_chip— 筹码分布stock_fund_flow— 个股资金流向stock_sector_spot— 板块行情stock_board_cons— 板块成分股
A-Stock (估值财务)
stock_market_pe_percentile— 市场PE分位stock_industry_pe— 行业PEstock_dividend_history— 分红历史stock_institutional_holdings— 基金持仓stock_earnings_calendar— 业绩披露日历stock_financial_compare— 财务对比
A-Stock (股东)
stock_locked_shares— 限售解禁stock_pledge_ratio— 质押比例stock_top10_holders— 十大股东
A-Stock (量化)
backtest_strategy— 回测策略
US Stock
stock_prices_global— 全球股票K线stock_overview_us— 美股概览stock_financials_us— 美股财报stock_earnings_us— 美股业绩stock_insider_us— 内部交易stock_news_us— 美股新闻stock_tech_indicators_us— 美股技术指标
Crypto
okx_prices— OKX行情okx_loan_ratios— OKX借贷比okx_taker_volume— OKX主动买卖量binance_ai_report— Binance AI报告
Market & News
stock_news— 个股新闻stock_news_global— 全球财经新闻data_source_status— 数据源状态
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
open_stock_data-0.1.3.tar.gz
(80.4 kB
view details)
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 open_stock_data-0.1.3.tar.gz.
File metadata
- Download URL: open_stock_data-0.1.3.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c143c4696c91ddd2737a8e53b6c455ab920ce8a57c24a810ed40a28810db32c0
|
|
| MD5 |
f291acb905d835e92e9587e2430feb11
|
|
| BLAKE2b-256 |
f081db99537176b6ab703c92a52ef1a40f0f5ee13ed998a2b45886a4eaaeeef7
|
File details
Details for the file open_stock_data-0.1.3-py3-none-any.whl.
File metadata
- Download URL: open_stock_data-0.1.3-py3-none-any.whl
- Upload date:
- Size: 96.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56fcabfc03f882d11328b3fc9f65c1c785f783d777827fa66b7a152b20de724f
|
|
| MD5 |
0b7bb76b2dad0ede6769962c23676df0
|
|
| BLAKE2b-256 |
f861af7f928be606eda5d8b882403c26d78fd12e10ad69ec04ca47b55d5a1df0
|