Git Product home page Git Product logo

opendata's People

Contributors

pkujohnson avatar quantosorg avatar ustc-xchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opendata's Issues

The module "realestate" is not available

After update to version 0.4.7 (Python 3.6.5), the module "realestate" cannot get the data from Anjuke, both get_city_list() and get_real_house_price() returned None.
I have review the module, I found that Anjuke add 2 CAPTCHA, so Anjuke_Agent will not able to get the data.

P.S.There are sth wrong on the wiki of realestate:

df = realestate.realestate.get_real_house_price('北京')

THX

参数能否添加说明

比如coin.get_his_hour()里面的fsmy,tsmy是什么含义?如何正确传递参数?
谢谢~

spot error

OpenData/opendatatools/spot/spot_agent.py 107 行 -psm 6 应该改为 --psm 6,
否则报错:
TesseractError: (1, "Error, unknown command line argument '-psm'")

环境 opensuse 64.

选股宝登陆方法还能用么?

现在似乎已经不需要注册了,短信验证码登陆或者直接微信登陆,不再需要密码了。现在的登陆方法貌似用不了

私募接口报错

df, msg = hedgefund.get_fund_nav('HF0000141Y')

/opendatatools/hedgefund/hedgefund_interface.py

224 tag = "return xOrEncrypt(str, "
225 else:
--> 226 tag = "return bitEncrypt(str, "
227 pos = response.index(tag) + len(tag) + 1
228 key = response[pos:pos+32]

ValueError: substring not found

沪港通交易数据报错

用 hsgt.get_lgt_share() 爬取交易数据时报错如下:
FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?

ProxyError: HTTPSConnectionPool(host='www.anjuke.com', port=443)

An proxyerror happens while following code was running, someone can help me to fix this issue? Thanks.

from opendatatools import realestate
city_list = realestate.get_city_list()
print(city_list)
> ProxyError: HTTPSConnectionPool(host='www.anjuke.com', port=443): Max retries exceeded with url: /sy-city.html (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x113aa5b70>: Failed to establish a new connection: [Errno 61] Connection refused',)))

JSONDecodeError: Expecting property name enclosed in double quotes

import pandas as pd
from pyecharts import Bar

def draw_price(city_list, title):
    df_list = []
    for city in city_list:
        df, msg = realestate.get_real_house_price(city)
        if df is not None:
            df_list.append(df)
    
    df = pd.concat(df_list)
    df = df[df['date'] == '201807']
    df.sort_values('price', inplace=True, ascending=True)
    
    axis_x = df['city']
    axis_y = df['price']

    bar = Bar(title, width=600, height=600)
    bar.add("房价", axis_x, axis_y, is_convert=True, is_label_show=True, 
					bar_category_gap='50%', label_pos='right')
    return bar

# 一线城市房价比拼
draw_price(['北京', '上海', '广州', '深圳'], "一线城市房价大比拼")

When I run code above, there are following errors, does someone can help me to fix it? Thanks.

Traceback (most recent call last):

  File "<ipython-input-51-736af34863f3>", line 25, in <module>
    draw_price(['北京', '上海', '广州', '深圳'], "一线城市房价大比拼")

  File "<ipython-input-51-736af34863f3>", line 7, in draw_price
    df, msg = realestate.get_real_house_price(city)

  File "C:\Users\User\Anaconda3\lib\site-packages\opendatatools\realestate\realestate_interface.py", line 17, in get_real_house_price
    return anjuke_agent.get_real_house_price(city)

  File "C:\Users\User\Anaconda3\lib\site-packages\opendatatools\realestate\anjuke_agent.py", line 56, in get_real_house_price
    xyear = json.loads('{' + AnjukeAgent.extract_word(content, 'xyear:{', '},') + '}')

  File "C:\Users\User\Anaconda3\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)

  File "C:\Users\User\Anaconda3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "C:\Users\User\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)

JSONDecodeError: Expecting property name enclosed in double quotes

北上资金报错

北上流入实时数据提取显示报错
ConnectionError: HTTPConnectionPool(host='ff.eastmoney.com', port=80): Max retries exceeded with url: /EM_CapitalFlowInterface/api/js?id=north&type=EFR&rtntype=2&acces_token=1942f5da9b46b069953c873404aad4b5&js=%7B%22data%22:[(x)]%7D (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000270A7EC83C8>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))

增加全部A股列表的函数

目前好像只能通过get_index_component('000985.CSI')取中证全指的成分
但是成分股调整滞后,比全部A股少了190只左右

申万一级行业指数801060、801070获取数据失败

应该是申万指数源数据变更了获取方式或地址
KeyError Traceback (most recent call last)
in ()
----> 1 swindex.get_index_cons('801060')

E:\Anaconda3\envs\py35\lib\site-packages\opendatatools\swindex\swindex_interface.py in get_index_cons(index_code)
9
10 def get_index_cons(index_code):
---> 11 return sw_agent.get_index_cons(index_code)
12
13 def get_index_daily(index_code):

E:\Anaconda3\envs\py35\lib\site-packages\opendatatools\swindex\swindex_agent.py in get_index_cons(self, index_code)
74 })
75 df = pd.DataFrame(data)
---> 76 df['start_date'] = df['start_date'].apply(lambda x : datetime.datetime.strptime(x, '%Y/%m/%d %H:%M:%S'))
77 return df, ''
78

E:\Anaconda3\envs\py35\lib\site-packages\pandas\core\frame.py in getitem(self, key)
2686 return self._getitem_multilevel(key)
2687 else:
-> 2688 return self._getitem_column(key)
2689
2690 def _getitem_column(self, key):

E:\Anaconda3\envs\py35\lib\site-packages\pandas\core\frame.py in _getitem_column(self, key)
2693 # get column
2694 if self.columns.is_unique:
-> 2695 return self._get_item_cache(key)
2696
2697 # duplicate columns & possible reduce dimensionality

E:\Anaconda3\envs\py35\lib\site-packages\pandas\core\generic.py in _get_item_cache(self, item)
2487 res = cache.get(item)
2488 if res is None:
-> 2489 values = self._data.get(item)
2490 res = self._box_item_values(item, values)
2491 cache[item] = res

E:\Anaconda3\envs\py35\lib\site-packages\pandas\core\internals.py in get(self, item, fastpath)
4113
4114 if not isna(item):
-> 4115 loc = self.items.get_loc(item)
4116 else:
4117 indexer = np.arange(len(self.items))[isna(self.items)]

E:\Anaconda3\envs\py35\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3078 return self._engine.get_loc(key)
3079 except KeyError:
-> 3080 return self._engine.get_loc(self._maybe_cast_indexer(key))
3081
3082 indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'start_date'

index 那块有bug呀

from opendatatools import index 就出了一个bug

修改了了一下index_interface.py的import,又出来一个get_index_data() got an unexpected keyword argument 'symbol'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.