rquote 0.2.5__py3-none-any.whl → 0.2.6__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.
- rquote/__init__.py +3 -1
- rquote/main.py +0 -1
- rquote/utils.py +3 -2
- {rquote-0.2.5.dist-info → rquote-0.2.6.dist-info}/METADATA +5 -7
- rquote-0.2.6.dist-info/RECORD +8 -0
- rquote-0.2.5.dist-info/RECORD +0 -8
- {rquote-0.2.5.dist-info → rquote-0.2.6.dist-info}/WHEEL +0 -0
- {rquote-0.2.5.dist-info → rquote-0.2.6.dist-info}/top_level.txt +0 -0
rquote/__init__.py
CHANGED
|
@@ -7,7 +7,9 @@ Copyright (c) 2021 Roi ZHAO
|
|
|
7
7
|
|
|
8
8
|
'''
|
|
9
9
|
|
|
10
|
-
from .main import get_price, get_stock_concepts, get_concept_stocks
|
|
10
|
+
from .main import get_price, get_stock_concepts, get_concept_stocks, get_bk_stocks
|
|
11
11
|
from .main import get_all_concepts, get_all_industries
|
|
12
|
+
from .main import get_cn_stock_list, get_hk_stocks_hsi, get_hk_stocks_ggt
|
|
13
|
+
from .main import get_cn_future_list, get_us_stocks_biggest, get_cn_fund_list
|
|
12
14
|
from .utils import WebUtils, BasicFactors
|
|
13
15
|
from .plots import PlotUtils
|
rquote/main.py
CHANGED
|
@@ -192,7 +192,6 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
192
192
|
raise ValueError('target market not supported')
|
|
193
193
|
a = hget(url)
|
|
194
194
|
#a = json.loads(a.text.replace('kline_dayqfq=', ''))['data'][i]
|
|
195
|
-
print('=====',url,a)
|
|
196
195
|
a = json.loads(a.text)['data'][i]
|
|
197
196
|
name = ''
|
|
198
197
|
try:
|
rquote/utils.py
CHANGED
|
@@ -52,7 +52,7 @@ class WebUtils:
|
|
|
52
52
|
return header
|
|
53
53
|
|
|
54
54
|
@classmethod
|
|
55
|
-
def
|
|
55
|
+
def http_get(cls, url, headers, method, proxy=None):
|
|
56
56
|
'''
|
|
57
57
|
request.get() wrapper
|
|
58
58
|
'''
|
|
@@ -187,7 +187,8 @@ class hget:
|
|
|
187
187
|
self.url = url
|
|
188
188
|
try:
|
|
189
189
|
r = httpx.get(
|
|
190
|
-
self.url, follow_redirects=True,
|
|
190
|
+
self.url, follow_redirects=True, headers=WebUtils.headers(),
|
|
191
|
+
*args, **kwargs)
|
|
191
192
|
self.text = r.text
|
|
192
193
|
self.content = r.content
|
|
193
194
|
except Exception as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rquote
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Mostly day quotes of cn/hk/us/fund/future markets, side with quote list fetch
|
|
5
5
|
Home-page: https://github.com/kids/rquote
|
|
6
6
|
Author: Roizhao
|
|
@@ -9,6 +9,8 @@ Requires-Python: >=3.4.0
|
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
Requires-Dist: httpx>=0.20.0
|
|
11
11
|
Requires-Dist: pandas>=1.0.0
|
|
12
|
+
Requires-Dist: setuptools>=59.6.0
|
|
13
|
+
Requires-Dist: twine>=3.8.0
|
|
12
14
|
Dynamic: author
|
|
13
15
|
Dynamic: author-email
|
|
14
16
|
Dynamic: home-page
|
|
@@ -16,11 +18,11 @@ Dynamic: requires-python
|
|
|
16
18
|
|
|
17
19
|
# rquote
|
|
18
20
|
|
|
19
|
-
`get_price`方法提供 A股/港股/美股/ETF基金/期货
|
|
21
|
+
`get_price`方法提供 A股/港股/美股/ETF基金/期货 日线历史数据获取
|
|
20
22
|
|
|
21
23
|
使用新浪/腾讯的id形式,如`sh000001`表示上证指数,`sz000001`表示深市000001股票`平安银行`,`sh510050`表示上证50指数ETF,`hk00700`表示港股腾讯。
|
|
22
24
|
期货代码需加`fu`前缀,如`fuAP2110`,美股需加对应交易所后缀,如`usBABA.N`,`usC.N`,`usAAPL.OQ`等
|
|
23
|
-
BTC/USD
|
|
25
|
+
BTC/USD也放在fu下面,i.d.`fuBTC`
|
|
24
26
|
|
|
25
27
|
e.g.
|
|
26
28
|
```
|
|
@@ -36,7 +38,3 @@ df.head() # 数据为pandas dataframe
|
|
|
36
38
|
> 2024-02-19 2886.59 2910.54 2910.54 2867.71 458967704.0
|
|
37
39
|
> 2024-02-20 2902.88 2922.73 2927.31 2887.47 350138735.0
|
|
38
40
|
|
|
39
|
-
Notes:
|
|
40
|
-
使用GenImage需要补充依赖
|
|
41
|
-
> kaleido>=1.0.0rc0
|
|
42
|
-
> plolty>=5.0.0
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
rquote/__init__.py,sha256=RmJldXUSwytbaIoML4H4DHU_-oWzrTcwnLGXrLVQFzM,451
|
|
2
|
+
rquote/main.py,sha256=2qoFZN1d9TU89rEZj5SEWRh9X86DT6B9xkTY47L4dNs,17083
|
|
3
|
+
rquote/plots.py,sha256=N8uvD6ju9tow0DllPQiXiM7EoPC2bK8X7QF6NQainKs,2342
|
|
4
|
+
rquote/utils.py,sha256=v8j8R2xoXyTsHSAWXD7x2FUV7w1a4xgfswfSDdfg5p8,6827
|
|
5
|
+
rquote-0.2.6.dist-info/METADATA,sha256=zu1H9gPSzD8hARNDK82MWDCR26bYroFMJKDLxE1-s3s,1457
|
|
6
|
+
rquote-0.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
rquote-0.2.6.dist-info/top_level.txt,sha256=CehAiaZx7Fo8HGoV2zd5GhILUW1jQEN8YS-cWMlrK9Y,7
|
|
8
|
+
rquote-0.2.6.dist-info/RECORD,,
|
rquote-0.2.5.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
rquote/__init__.py,sha256=hTIZoLK37R9sSJdjnmCLA-P6wHcm1u4pgNx89Gsq1lI,284
|
|
2
|
-
rquote/main.py,sha256=CoZ1EBGSbSJ1422wotxWKXAjaGjVAZwMDnmIsz9iAeE,17108
|
|
3
|
-
rquote/plots.py,sha256=N8uvD6ju9tow0DllPQiXiM7EoPC2bK8X7QF6NQainKs,2342
|
|
4
|
-
rquote/utils.py,sha256=ztDIlW9UyJQHPO_Q-DCzp0sOsKT24sFdHhpizw3P9x8,6781
|
|
5
|
-
rquote-0.2.5.dist-info/METADATA,sha256=Dfe3VO9e41TSmHWwh32rwSxDd9sPQGJR5-v7QQsFzzs,1493
|
|
6
|
-
rquote-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
rquote-0.2.5.dist-info/top_level.txt,sha256=CehAiaZx7Fo8HGoV2zd5GhILUW1jQEN8YS-cWMlrK9Y,7
|
|
8
|
-
rquote-0.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|