micro-sheep / efinance Goto Github PK
View Code? Open in Web Editor NEWefinance 是一个可以快速获取基金、股票、债券、期货数据的 Python 库,回测以及量化交易的好帮手!🚀🚀🚀
License: MIT License
efinance 是一个可以快速获取基金、股票、债券、期货数据的 Python 库,回测以及量化交易的好帮手!🚀🚀🚀
License: MIT License
df = ef.stock.get_quote_history(['000001', '000002'], beg='19000101', end='20500101', klt=5)
这个代码返回的只有2021-05-31之后的数据,之前的数据要怎么获取呢?
您好,这个包存在
[Errno 13] Permission denied: '/usr/local/py36_env/aiipo_data/lib/python3.6/site-packages/efinance/config/../data/search-cache.json' 问题。
我已经给了读写权限了
sudo chmod a+rwx /usr/local/py36_env/aiipo_data/lib/python3.6/site-packages/efinance/data
但还是不行
如 885573-猪肉 881153-房地产 885934-元宇宙等
get_quote_history获取的1分钟数据只有最近一天的,5分钟可以历史数据,但是1分钟不行
能不能在stock或者foud里查询lof的分时数据?目前stock 里可以查ETF的分时数据,但不能查lof的,这个能不能改进?或者给个提示我临时解决一下。谢谢
%%time
data=ef.stock.get_quote_history(hs300,beg='20210729',)
CPU times: user 12.9 s, sys: 1.3 s, total: 14.2 s
Wall time: 1min 25s
%%time
all_stock=ef.stock.get_realtime_quotes()
CPU times: user 198 ms, sys: 1.96 ms, total: 200 ms
Wall time: 816 ms
获取300指股票 一天的日线数据 需要1分25秒
获取全市场 实时数据 816ms
获取多票k线数据是否有提速的可能?
大佬,我只看到ef.stock.get_quote_history(stock_code)接口获取某个股票所有天的数据
请问怎么获取某天所有股票的数据?
原因大概是因为json的decoder有问题,
debug到decorder文件的这部分
def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):
"""Decode a JSON document from s
(a str
or unicode
beginning with a JSON document) and return a 2-tuple of the Python
representation and the index in s
where the document ended.
Optionally, idx
can be used to specify an offset in s
where
the JSON document begins.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
if idx < 0:
# Ensure that raw_decode bails on negative indexes, the regex
# would otherwise mask this behavior. #98
raise JSONDecodeError('Expecting value', s, idx)
if _PY3 and not isinstance(s, str):
raise TypeError("Input string must be text, not bytes")
# strip UTF-8 bom
if len(s) > idx:
ord0 = ord(s[idx])
if ord0 == 0xfeff:
idx += 1
elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
idx += 3
return self.scan_once(s, idx=_w(s, idx).end())
报错是
JSONDecodeError: Expecting value
请问有接口可以获取股票收盘时候的市值吗
import efinance as ef
ef.stock.get_all_company_performance()
股票代码 股票简称 公告日期 ... 净资产收益率 销售毛利率 每股经营现金流量
0 000509 *ST华塑 2022-01-18 00:00:00 ... -3.89 15.524368 -0.131965
[1 rows x 14 columns]
Traceback (most recent call last):
File "/home/sundong/Stocks-Analyse/StockRealTime.py", line 184, in
strategy.next()
File "/home/sundong/Stocks-Analyse/StockRealTime.py", line 99, in next
quotes = ef.stock.get_realtime_quotes()
File "/home/sundong/anaconda3/lib/python3.7/site-packages/efinance/utils/init.py", line 246, in wrapper
values = func(*args, **kwargs)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/efinance/utils/init.py", line 36, in run
values = func(*args, **kwargs)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/efinance/stock/getter.py", line 384, in get_realtime_quotes
df = get_realtime_quotes_by_fs(fs_str)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/efinance/utils/init.py", line 36, in run
values = func(*args, **kwargs)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/efinance/common/getter.py", line 47, in get_realtime_quotes_by_fs
df = df[EASTMONEY_QUOTE_FIELDS.values()]
File "/home/sundong/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2688, in getitem
return self._getitem_column(key)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2695, in _getitem_column
return self._get_item_cache(key)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 2489, in _get_item_cache
values = self._data.get(item)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/pandas/core/internals.py", line 4115, in get
loc = self.items.get_loc(item)
File "/home/sundong/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 140, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 162, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1492, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1500, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: dict_values(['代码', '名称', '涨跌幅', '最新价', '最高', '最低', '今开', '涨跌额', '换手率', '量比', '动态市盈率', '成交量', '成交额', '昨日收盘', '总市值', '流通市值', '市场编号'])
我的环境是python3.7+efinace0.4.2
def get_quote_history(stock_codes: Union[str, List[str]],
beg: str = '19000101',
end: str = '20500101',
klt: int = 101,
fqt: int = 1) -> Union[pd.DataFrame, Dict[str, pd.DataFrame]]:
比如klt=30,那每天也就8条数据,但获取数据时,比如,我仅想获取10:30的数据,其他条暂时不要,可否再加入时间Time的beg和end参数?
请问有社区或者QQ群吗
这是 efinance
的新特性收集区,欢迎需要添加新特性的人来提建议,我会认真地看大家的反馈和建议,并且会考虑把它添加到 efinance
中。
其中,新特性包括下面几个方面
还有其他方面的新特性我可能没有考虑到,也欢迎大家来探讨。
Processing => 300355: 1%|▏ | 69/4714 [00:15<13:53, 5.57it/s]Traceback (most recent call last):
File "/Users/zhanghui/Documents/Program/实时获取行情efinance-main/test.py", line 35, in
st = ef.stock.get_quote_history(code)
File "/Users/zhanghui/Documents/Program/实时获取行情efinance-main/efinance/stock/getter.py", line 246, in get_quote_history
fqt=fqt
File "/Users/zhanghui/Documents/Program/实时获取行情efinance-main/efinance/common/getter.py", line 207, in get_quote_history
Processing => 600091: 1%|▏ | 70/4714 [00:16<20:29, 3.78it/s] **kwargs)
File "/Users/zhanghui/Documents/Program/实时获取行情efinance-main/efinance/common/getter.py", line 140, in get_quote_history_multi
start(code)
File "/opt/anaconda3/lib/python3.7/site-packages/multitasking/init.py", line 119, in async_method
Processing => 300386: 2%|▏ | 71/4714 [00:16<19:00, 4.07it/s]
File "/opt/anaconda3/lib/python3.7/threading.py", line 852, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
这个是不是我电脑不行,所以停止了多线程?
请教一下 http://push2.eastmoney.com/ 下的接口是怎么抓到的?我之前在ios客户端上貌似没有抓到这个域名下的接口
看了一下好像没有这个功能,stock和fund里都获取不到
ef.fund.get_fund_codes(ft = 'gp')
基金代码 基金简称
0 003834 华夏能源革新股票
1 005669 前海开源公用事业股票
2 004040 金鹰医疗健康产业A
3 517793 1.20%
517793 1.20%
数据有误
应该 把 columns = ['基金代码', '基金简称']
results = re.findall('(\d{6}),(.*?),', response.text)
改为
text = text[text.index('["') + 2:text.index('"]')]
fs = text.split('","')
datas = {'基金代码': [], '基金简称': [], '净值': []]}
for f in fs:
data = f.split(',')
datas['基金代码'].append(data[0])
datas['基金简称'].append(data[1])
如题,怎么破?
如何通过接口获取一只股票当日的炸板次数和一段时间内的连板次数
请问大佬,如何将获取的行情数据 保存到excel中
例如我需要一个股票自上市以来最初的1个月内的交易价格、交易量、换手率等数据
怎么能获取股票每天的收盘价?
您好,如题,在进度条走完(Processing 100%)之后,便卡住不动
比如每天查询多少条? 或者怎么样的? 不知道有没有说明
我用了全部股票代码试了一下昨天的数据获取, 总体成功了,除了如下4个代码。 我单独抽取了这些异常log的股票代码。 请帮助看看,是什么原因?是否代码异常处理里面处理一下这个类型的异常
601206
603302
688688
300646
0%| | 0/4 [00:00<?, ?it/s]Exception in thread Thread-5:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 910, in run
self._target(*self._args, **self.kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\multitasking_init.py", line 102, in _run_via_pool
return callee(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in __retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 201, in start
df = get_quote_history_single(
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 34, in run
values = func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 154, in get_quote_history_single
quote_id = get_quote_id(stock_code)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in _retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 87, in get_quote_id
raise Exception(f'证券代码 {stock_code} 可能有误')
Exception: 证券代码 300646 可能有误
Exception in thread Thread-3:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 910, in run
self._target(*self._args, **self.kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\multitasking_init.py", line 102, in _run_via_pool
return callee(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in __retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 201, in start
df = get_quote_history_single(
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 34, in run
values = func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 154, in get_quote_history_single
quote_id = get_quote_id(stock_code)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in _retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 87, in get_quote_id
raise Exception(f'证券代码 {stock_code} 可能有误')
Exception: 证券代码 603302 可能有误
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 910, in run
self._target(*self._args, **self.kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\multitasking_init.py", line 102, in _run_via_pool
return callee(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in __retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 201, in start
df = get_quote_history_single(
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 34, in run
values = func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 154, in get_quote_history_single
quote_id = get_quote_id(stock_code)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in _retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 87, in get_quote_id
raise Exception(f'证券代码 {stock_code} 可能有误')
Exception: 证券代码 601206 可能有误
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\threading.py", line 910, in run
self._target(*self._args, **self.kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\multitasking_init.py", line 102, in _run_via_pool
return callee(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in __retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 201, in start
df = get_quote_history_single(
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 34, in run
values = func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\stock\getter.py", line 154, in get_quote_history_single
quote_id = get_quote_id(stock_code)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\retry\api.py", line 33, in _retry_internal
return f()
File "C:\ProgramData\Anaconda3\envs\pythonProject\lib\site-packages\efinance\utils_init.py", line 87, in get_quote_id
raise Exception(f'证券代码 {stock_code} 可能有误')
Exception: 证券代码 688688 可能有误
0%| | 0/4 [00:08<?, ?it/s]
自 efinance v0.2.8 开始,你可以获取美股、港股、可转债以及 ETF 数据。具体使用例子在 README.md 中有展示。更新 efinance 的方法如下
pip install efinance --upgrade
我使用下面这行代码去获取603266这只股票在2022年4月19号的分钟k线数据。
ef.stock.get_quote_history(‘603266’, 20220419, 20220419, 1)
结果返回了今天的分钟k线数据。
股票名称 股票代码 日期 开盘 收盘 最高 最低 成交量 成交额 振幅 涨跌幅 涨跌额 换手率
0 天龙股份 603266 2022-05-18 09:31 16.79 16.30 16.79 16.30 15657 26045530.0 2.91 -3.15 -0.53 0.79
1 天龙股份 603266 2022-05-18 09:32 16.30 16.37 16.37 16.16 8354 13571944.0 1.29 0.43 0.07 0.42
2 天龙股份 603266 2022-05-18 09:33 16.46 16.58 16.74 16.46 4596 7627996.0 1.71 1.28 0.21 0.23
3 天龙股份 603266 2022-05-18 09:34 16.58 16.48 16.68 16.48 4460 7403235.0 1.21 -0.60 -0.10 0.22
4 天龙股份 603266 2022-05-18 09:35 16.45 16.38 16.45 16.28 4518 7380003.0 1.03 -0.61 -0.10 0.23
.. ... ... ... ... ... ... ... ... ... ... ... ... ...
115 天龙股份 603266 2022-05-18 11:26 16.90 16.92 16.92 16.90 118 199490.0 0.12 0.12 0.02 0.01
116 天龙股份 603266 2022-05-18 11:27 16.91 16.90 16.91 16.90 191 322853.0 0.06 -0.12 -0.02 0.01
117 天龙股份 603266 2022-05-18 11:28 16.89 16.89 16.90 16.88 276 466180.0 0.12 -0.06 -0.01 0.01
118 天龙股份 603266 2022-05-18 11:29 16.89 16.88 16.89 16.88 306 516720.0 0.06 -0.06 -0.01 0.02
119 天龙股份 603266 2022-05-18 11:30 16.88 16.89 16.89 16.88 336 567283.0 0.06 0.06 0.01 0.02
希望大佬帮忙解答。
How can I get live data in EST time, instead of Beijing time?
ef.stock.get_latest_quote(code)
股票代码 | 股票名称 | 涨跌幅 | 最新价 | 最高 | 最低 | 涨跌额 | 换手率 | 动态市盈率 | 成交量 | 成交额 | 昨日收盘 | 总市值 | 流通市值 | 市场类型 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
515650 | 消费50ETF | 0.27 | 1.4630 | 1.4670 | 1.4470 | 0.0040 | 2.97 | 0.0 | 299247 | 4.352412e+07 | 1.4590 | 1473510192 | 1473510192 | 沪A |
ef.stock.get_realtime_quotes()
股票代码 | 股票名称 | 涨跌幅 | 最新价 | 最高 | 最低 | 涨跌额 | 换手率 | 动态市盈率 | 成交量 | 成交额 | 昨日收盘 | 总市值 | 流通市值 | 行情ID | 市场类型 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
601139 | 深圳燃气 | 10.04 | 10.63 | 10.63 | 9.31 | 0.97 | 2.64 | 17.94 | 760195 | 753869120.0 | 9.66 | 30580038993 | 30579645151 | 1.601139 | 沪A |
如果能添加今日开盘 这个字段,日线时间切片数据就齐了。
调用该接口 ef.stock.get_quote_snapshot(bond_code)
,报以下错误,请问大佬如何解决
File "F:\Programs\Python\Python310\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "F:\Programs\Python\Python310\lib\site-packages\retry\api.py", line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File "F:\Programs\Python\Python310\lib\site-packages\retry\api.py", line 33, in __retry_internal return f() File "F:\Programs\Python\Python310\lib\site-packages\efinance\stock\getter.py", line 1335, in get_quote_snapshot response = requests.get( File "F:\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='hsmarketwg.eastmoney.com', port=443): Max retries exceeded with url: /api/SHSZQuoteSnapshot?id=123120&callback=jQuery183026310160411569883_1646052793441 (Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:997)')))
虽然大多数都还有好几年,但也有快到期的。。比如https://xueqiu.com/S/SZ123007
看这个库用的都是东财源,东财的确是没有这一项。。雪球的有(集思录有登陆限制),
(https://xueqiu.com/hq#exchange=CN&industry=4_0&firstName=4)
不知道方不方便爬。。我水平实在有限。还是通过tqsdk接触python的,还不到1年。。
你在r4s面板上安装失败,但我在x86面板上安装就成功,是不是有库不支持arm?谢谢
如题,我发现对于股票和债券是有获取历史K线数据的功能
辛苦问一下有时间可以新增一个获取基金历史净值的数据,
感谢感谢~~
当传入的列表长度好像大于600多就会报错。
Traceback (most recent call last):
File "G:\StockSpider\main.py", line 100, in
stockData = pandas.DataFrame(efinance.stock.get_latest_quote(stocks))
File "C:\Python39\lib\site-packages\efinance\utils_init_.py", line 36, in run
values = func(*args, **kwargs)
File "C:\Python39\lib\site-packages\efinance\stock\getter.py", line 515, in get_latest_quote
json_response = session.get(url,
File "C:\Users\opiiopo\AppData\Roaming\Python\Python39\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
如何获取一支股票所属的板块和概念呢?
举个例子,515790的跟踪标的是:”中证光伏产业指数“。这个指数的代码是:931151。
http://fundf10.eastmoney.com/jbgk_515790.html
上面这个网页好像没有发用东财api获取 跟踪标的(”中证光伏产业指数“)这个值。
更没办法找到这个指数的代码931151。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.