rquote 0.3.3__py3-none-any.whl → 0.3.4__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/main.py
CHANGED
|
@@ -218,6 +218,8 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
218
218
|
d = json.loads(hget(url).text)['result']['data'].split('|')
|
|
219
219
|
d = pd.DataFrame([i.split(',') for i in d],
|
|
220
220
|
columns=['date', 'open', 'high', 'low', 'close', 'vol', 'amount'])
|
|
221
|
+
for col in ['open','high','low','close','vol','amount']:
|
|
222
|
+
d[col] = pd.to_numeric(d[col], errors='coerce')
|
|
221
223
|
return i, 'BTC', d
|
|
222
224
|
else:
|
|
223
225
|
ix = i[2:]
|
|
@@ -227,6 +229,8 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
227
229
|
# d = pd.DataFrame(json.loads(rtext.split(i[2:])[1][2:-2]))
|
|
228
230
|
d = pd.DataFrame(load_js_var_json(url))
|
|
229
231
|
d.columns = ['dtime', 'close', 'avg', 'vol', 'hold','last_close','cur_date']
|
|
232
|
+
for col in ['close','avg','vol','hold']:
|
|
233
|
+
d[col] = pd.to_numeric(d[col], errors='coerce')
|
|
230
234
|
d = d.set_index(['dtime'])
|
|
231
235
|
return i[2:], i[2:], d
|
|
232
236
|
else:
|
|
@@ -234,6 +238,8 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
234
238
|
# ix, ix)).text.split('(')[1][:-2]))
|
|
235
239
|
d = pd.DataFrame(load_js_var_json(sina_future_d.format(ix, ix)))
|
|
236
240
|
d.columns = ['date', 'open', 'high', 'low', 'close', 'vol', 'p', 's']
|
|
241
|
+
for col in ['open','high','low','close','vol','p','s']:
|
|
242
|
+
d[col] = pd.to_numeric(d[col], errors='coerce')
|
|
237
243
|
d = d.set_index(['date']).astype(float)
|
|
238
244
|
# d.index = pd.DatetimeIndex(d.index)
|
|
239
245
|
return i, ix, d
|
|
@@ -260,7 +266,9 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
260
266
|
a = json.loads(a.text.split('=')[1])['data'][i]
|
|
261
267
|
nm = a['qt'][i][1]
|
|
262
268
|
b = pd.DataFrame([i.split() for i in a['data']['data']],
|
|
263
|
-
|
|
269
|
+
columns=['minute','price','volume']).set_index(['minute'])
|
|
270
|
+
for col in ['price','volume']:
|
|
271
|
+
b[col] = pd.to_numeric(b[col], errors='coerce')
|
|
264
272
|
return i, nm, b
|
|
265
273
|
a = json.loads(a.text)['data'][i]
|
|
266
274
|
name = ''
|
|
@@ -271,12 +279,10 @@ def get_price(i, sdate='', edate='', freq='day', days=320, fq='qfq',
|
|
|
271
279
|
tk = tkt
|
|
272
280
|
break
|
|
273
281
|
b = pd.DataFrame([j[:6] for j in a[tk]],
|
|
274
|
-
columns=['date',
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
'low',
|
|
279
|
-
'vol']).set_index(['date']).astype(float)
|
|
282
|
+
columns=['date','open','close','high','low','vol']
|
|
283
|
+
).set_index(['date'])
|
|
284
|
+
for col in ['open','high','low','close','vol']:
|
|
285
|
+
b[col] = pd.to_numeric(b[col], errors='coerce')
|
|
280
286
|
if 'qt' in a:
|
|
281
287
|
name = a['qt'][i][1]
|
|
282
288
|
except Exception as e:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
rquote/__init__.py,sha256=PB620yEq2QZyfDweKY_8qMEsZMKhskGfhmfDkch_0j0,462
|
|
2
|
+
rquote/main.py,sha256=HFSRvUrWOo6tmZNpyWuIlGF0p32SgYyrwmjmIQyLQNg,20452
|
|
3
|
+
rquote/plots.py,sha256=N8uvD6ju9tow0DllPQiXiM7EoPC2bK8X7QF6NQainKs,2342
|
|
4
|
+
rquote/utils.py,sha256=4Neb9_R-EKAd6s1Qj4O_vs9jXWyvroxEEhdqH35vxVE,6808
|
|
5
|
+
rquote-0.3.4.dist-info/METADATA,sha256=txSHL6ckkJkLgz5OomCVp469GGX3rb15mN9jqPrqnY0,7301
|
|
6
|
+
rquote-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
rquote-0.3.4.dist-info/top_level.txt,sha256=CehAiaZx7Fo8HGoV2zd5GhILUW1jQEN8YS-cWMlrK9Y,7
|
|
8
|
+
rquote-0.3.4.dist-info/RECORD,,
|
rquote-0.3.3.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
rquote/__init__.py,sha256=PB620yEq2QZyfDweKY_8qMEsZMKhskGfhmfDkch_0j0,462
|
|
2
|
-
rquote/main.py,sha256=6o-eBvjUoUKLLPRxL6gkXbOje8y3tBlgjrVKz68GD-8,19982
|
|
3
|
-
rquote/plots.py,sha256=N8uvD6ju9tow0DllPQiXiM7EoPC2bK8X7QF6NQainKs,2342
|
|
4
|
-
rquote/utils.py,sha256=4Neb9_R-EKAd6s1Qj4O_vs9jXWyvroxEEhdqH35vxVE,6808
|
|
5
|
-
rquote-0.3.3.dist-info/METADATA,sha256=FNkt0vuPh7Zxs5D_VepHEtvEx6g49i0FnAZ6veSE5aM,7301
|
|
6
|
-
rquote-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
rquote-0.3.3.dist-info/top_level.txt,sha256=CehAiaZx7Fo8HGoV2zd5GhILUW1jQEN8YS-cWMlrK9Y,7
|
|
8
|
-
rquote-0.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|