{ "info": { "author": "1dot75cm", "author_email": "sensor.wen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Topic :: Utilities" ], "description": "# xueqiu\na humanize XueQiu API wrappers.\n\n## Installation\n\n1.First, you need to install some basic components.\n- [git-scm](https://www.git-scm.com/download/)\n- [python3](https://www.python.org/downloads/)\n- [nodejs](https://nodejs.org/en/download/current/) (needs `node` command in the PATH variable)\n\n2.And then, install [Google Chrome Browser](https://www.google.cn/chrome/?standalone=1&platform=win64&extra=stablechannel) and [Chrome Driver](http://chromedriver.chromium.org/).\n\n```sh\n> copy chromedriver.exe %LOCALAPPDATA%\\Programs\\Python\\Python37-32\\\n```\n\n3.Finally, install `xueqiu` via `pip`.\n\n```sh\n$ pip install xueqiu # OR git+https://github.com/1dot75cm/xueqiu@master\n$ pip install git+https://github.com/1dot75cm/browsercookie@master\n$ python3 -m xueqiu\nxueqiu x.y.z - A humanize XueQiu API wrappers.\n\n:copyright: (c) 2019 by 1dot75cm.\n:license: MIT, see LICENSE for more details.\n```\n\nenjoy!!!\n\n## Quick start\n\nExample:\n\n```python\n>>> news = xueqiu.news() # watch the news\n>>> news\n{'list': [,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ],\n 'next_max_id': 20323343}\n>>> p = news['list'][0]\n>>> \"{} {} \u8d5e{} \u8bc4\u8bba{} \u8f6c\u53d1{} {}\".format(p.title, p.user.name, p.like_count,\n p.reply_count, p.retweet_count, p.target)\n'\u4e3a\u4f55\u4ef7\u503c\u6295\u8d44\u957f\u671f\u6709\u6548 \u623f\u6768\u51ef\u7684\u6295\u8d44\u4e16\u754c \u8d5e9 \u8bc4\u8bba11 \u8f6c\u53d19 https://xueqiu.com/8291461932/120351059'\n>>> p.user.get_posts() # get user's article\n>>> p.user.posts\n{'count': 622,\n 'page': 1,\n 'maxpage': 63,\n 'list': [,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ]}\n>>> p.user.posts['list'][0].text # content\n'\u56de\u590d@A8\u5929\u9053\u916c\u52e4: \u8fd9\u4e2a\u95ee\u9898\u5e94\u8be5\u653e\u5728\u4e70\u4e4b\u524d\u3002//@A8\u5929\u9053\u916c\u52e4:\u56de\u590d@\u623f\u6768\u51ef\u7684\u6295\u8d44\u4e16\u754c:\u5047\u5982\u82b1\u65d7\u94f6\u884c\u505a\u5047\u8d26\uff0c\u8042\u592b\u8fd8\u4f1a\u4e0d\u4f1a\u6301\u6709\uff1f'\n>>> p.user.posts['list'][0].like() # like this (need login)\n```\n\n## API\n\n### User class\n\nA user class that contains user-related methods.\n\n*User object attributes:*\n\n- `id` - user id.\n- `profile` - user's profile url.\n- `name` - user name.\n- `city` - city, for example '\u4e0a\u6d77'.\n- `description` - user description.\n- `friends_count` - the number of user's friends.\n- `followers_count` - the number of user's fans.\n- `posts_count` - the number of user's post.\n- `stocks_count` - the number of stocks.\n- `friends` - use to save `User` object for friends.\n- `followers` - use the save `User` object for fans.\n- `posts` - use the save `Post` object for post.\n- `articles` - use the save `Post` object for user's article.\n- `favorites` - use the save `Post` object for favorite articles.\n- `stocks` - use the save `Stock` object for favorite stocks.\n- `hot_stocks` - use the save `Stock` object for the current hot stocks.\n\n*User object methods:*\n\n- `get_friends(page: int = 1)` - get your friends and save to `self.friends`.\n- `get_followers(page: int = 1)` - get your fans and save to `self.followers`.\n- `get_posts(page: int = 1, count: int = 10)` - get your posts and save to `self.posts`.\n- `get_articles(page: int = 1, count: int = 10)` - get your articles and save to `self.articles`.\n- `get_favorites(page: int = 1, count: int = 20)` - get your favorite posts and save to `self.favorites`.\n- `get_stocks(mkt: int = 1, count: int = 1000)` - get your stocks and save to `self.stocks`.\n- `get_hot_stocks(mkt: int = 10, time_range: str = \"hour\", count: int = 10)` - get hottest stocks.\n - :param `mkt`: (optional) market type, default is `10`.\n - value: \u5168\u7403`10` \u6caa\u6df1`12` \u6e2f\u80a1`13` \u7f8e\u80a1`11`\n - :param `time_range`: (optional) hottest stocks by time range, default is `hour`.\n - value: `hour`, `day`\n - :param `count`: (optional) the number of results, default is `10`.\n\n- `send_verification_code(phone: int)` - send verification code to your phone. **Note**: only 5 times a day.\n- `login(uid: str = '', passwd: str = '', login_type: str = 'phone')` - user login by password or verification code. If the cookie cache exists, load it first and return. Otherwise, login and save the cookie to file (Linux `~/.xueqiu/cookie` or Windows).\n - :param `uid`: your username or phone number.\n - :param `passwd`: your password or verification code.\n - :param `login_type`: (optional) login type, default is `phone`.\n - value: `password`, `phone`\n\n- `load_cookie()` - load cookies from local file or browser(chrome or firefox). You can login your account on the chrome browser, then execute `load_cookie()`, and now login successfully.\n\nExample:\n```python\n>>> u = User(2478797769)\n>>> u.name\n\"\u7ea2\u5229\u57fa\u91d1\"\n>>> u.get_posts()\n>>> u.posts['list'][0].title\n'\u3010\u4f60\u4e86\u89e3\u7ea2\u5229\u57fa\u91d1\u5417\u3011\u7ea2\u5229\u57fa\u91d1\uff08501029\uff09\u70ed\u95ee\u5feb\u7b54\uff01\uff0812.31\uff09'\n>>> u.get_favorites()\n>>> u.favorites['list'][0].title\n'2018\u5e74A\u80a1\u5927\u6570\u636e\u76d8\u70b9\uff1a30\u5f20\u56fe\u5c3d\u89c8\u5e02\u573a\u70ed\u70b9'\n```\n\n### Post class\n\nA post class that contains post-related methods.\n\n*Post object attributes:*\n\n- `id` - post id.\n- `user` - post authors. a `User` class object.\n- `created_at` - created time. a `Arrow` class object.\n- `target` - post url.\n- `view_count` - view count.\n- `reply_count` - reply count.\n- `retweet_count` - retweet count.\n- `fav_count` - favorites count.\n- `like_count` - like count.\n- `title` - post title.\n- `text` - post content.\n- `full_text` - the full content of the article.\n- `comments` - use the save `Comment` object for post.\n\n*Post object methods:*\n\n- `get_content()` - get article content and save to `self.full_text`.\n- `get_comments(page: int = 1, count: int = 20, asc: str = 'false')` - get article comments and save to `self.comments`.\n- `like()` - like the article. (require login)\n- `unlike()` - unlike the article. (require login)\n- `favorite()` - favorite the article. (require login)\n- `unfavorite()` - unfavorite the article. (require login)\n\nExample:\n```python\n>>> p = Post('2478797769/78869335')\n>>> p.user.name\n\"\u7ea2\u5229\u57fa\u91d1\"\n>>> p.created_at.format(\"YYYY-MM-DD\")\n\"2016-12-13\"\n>>> p.title\n'\u3010\u4f60\u4e86\u89e3\u7ea2\u5229\u57fa\u91d1\u5417\u3011\u7ea2\u5229\u57fa\u91d1\uff08501029\uff09\u70ed\u95ee\u5feb\u7b54\uff01\uff0812.31\uff09'\n>>> p.target\n\"https://xueqiu.com/2478797769/78869335\"\n>>> p.get_content()\n>>> p.full_text\n'\u76ee\u5f55\uff1a\\n\u4e00\u3001\\n\u534e\u5b9d\u6807\u666e\u4e2d\u56fdA\u80a1\u7ea2\u5229\u673a\u4f1a\u6307\u6570\u8bc1\u5238\u6295\u8d44\u57fa\u91d1\\n......'\n>>> p.get_comments()\n>>> p.comments['list'][-1].text\n'\u4e3a\u4ec0\u4e48\u6210\u4efd\u80a1\u4e2d\u6709\u5f88\u591a\u6b21\u65b0\u80a1\uff1f\u767e\u601d\u4e0d\u5f97\u5176\u89e3'\n```\n\n### Comment class\n\nA comment class that contains comment-related methods.\n\n*Comment object attributes:*\n\n- `id` - comment id.\n- `user` - comment authors. a `User` class object.\n- `post` - comment on an article. a `Post` class object.\n- `created_at` - created time. a `Arrow` class object.\n- `like_count` - like count.\n- `text` - comment content.\n\n*Comment object methods:*\n\n- `like()` - like the comment. (require login)\n- `unlike()` - unlike the comment. (require login)\n\nExample:\n```python\n>>> p = Post('2478797769/78869335')\n>>> p.get_comments()\n>>> c = p.comments['list'][0]\n>>> c.user.name\n'\u7ea2\u5229\u57fa\u91d1'\n>>> c.text\n'\u56de\u590d@\u5b59\u6d69\u4e91: \u600e\u4e48\u53ef\u80fd....2018\u5e74\u8dcc\u5e45\u4e3a24.54%\uff0c\u8f83\u4e3b\u6d41\u6307\u6570\u8dcc\u5e45\u8f83\u5c0f\u3002\u4e0d\u77e5\u9053\u60a850%\u591a\u662f\u54ea\u513f\u770b\u6765\u7684\u5462'\n```\n\n### Selector class\n\nThe `Selector` class implements a stock filter.\n\n*Selector object attributes:*\n\n- `market` - market string, default is `SH`.\n - value: `SH`, `HK`, `US`\n- `queries` - include default parameters with selector.\n\n*Selector object methods:*\n\n- `url()` - return a selector url string.\n- `help(range: str = \"base\", show: str = \"text\")` - show selector parameters.\n - :param `range`: (optional) parameters range, default is `base`.\n value:\n - SH: industries, areas, base, ball, quota, finan_rate, stock_data,\n profit_sheet, balance_sheet, cash_sheet\n - HK: industries, base, ball, quota\n - US: industries, base, ball, quota, grow,\n profit_sheet, balance_sheet, cash_sheet\n - :param `show`: (optional) output help or return generator, default is `text`.\n - value: `text`, `keys`\n- `scope(exchange: str = '', indcode: str = '', areacode: str = '')` - set stock selector scope.\n - :param `exchange`: (optional) set A-share exchange market, default is `None`.\n - value: `SH`, `SZ` or `None`\n - :param `indcode`: (optional) set industry code, default is `None`. please see `self.help('industries')`\n - :param `areacode`: (optional) set area code, default is `None`. please see `self.help('areas')`\n- `param(*args, **kwargs)` - set stock selector paramters.\n - :param `*args`: (optional) set parameters key, default value is `ALL`.\n for example, the `self.param('pb', 'mc')` will be set `pb=ALL&mc=ALL` params.\n - :param `**kwargs`: (optional) set parameters key and value.\n for example, the `self.param('pettm'=0_30)` will be set `pettm=0_30` param.\n- `orderby(key: str = 'symbol')` - stock selector results are sorted by field.\n - :param `key`: the results are sorted by the `key`, default is `symbol`.\n the key parameters can be viewed through `self.help('base')`.\n- `order(ord: str = 'desc')` - set stock selector results are sorted.\n - :param `ord`: the ascending and descending order, default is `desc`.\n - value: `asc`, `desc`\n- `page(page: int = 1)` - set stock selector results page number.\n- `count(size: int = 10)` - the number of stock selector results.\n- `run()` - sends a stock screener request and return `[Stock class]` list.\n\nExample:\n```python\n>>> s = Selector(\"SH\")\n# scope \u6df1\u5e02\uff0c\u623f\u5730\u4ea7\uff0c\u6d59\u6c5f\u5730\u533a\n# param \u7b5b\u9009\u603b\u5e02\u503c\uff0c18\u5e743\u5b63\u5ea6ROE 0-30%\n# orderby \u6309\u5e02\u503c\u6392\u5e8f\n# order \u5347\u5e8f\u6392\u5217\n# page \u7b2c2\u9875\n# count \u6bcf\u98752\u4e2a\n>>> result = s.scope('SZ','K70','CN330000').param('mc', roediluted_20180930='0_30').orderby('mc').order('asc').page(2).count(2).run()\n>>> result['list']\n[, ]\n```\n\n### Stock class\n\nA stock class that contains stock-related methods.\n\n*Stock object attributes:*\n\nbase\n- `symbol` - stock symbol.\n- `code` - stock code.\n- `name` - stock name.\n- `current` - current price.\n- `current_year_percent` - current year return.\n- `percent` - change rate.\n- `chg` - change amount.\n- `open` - price today.\n- `last_close` - last close.\n- `high` - highest.\n- `low` - lowest.\n- `avg_price` - average price.\n- `volume` - trading volume.\n- `amount` - amount.\n- `turnover_rate` - turnover rate.\n- `amplitude` - amplitude.\n- `market_capital` - market capital.\n- `float_market_capital` - float market capital.\n- `total_shares` - total shares.\n- `float_shares` - float shares.\n- `currency` - currency unit.\n- `exchange` - stock exchange.\n- `issue_date` - launch date. a `Arrow` class object.\n\nextend\n- `limit_up` - stock limit up.\n- `limit_down` - stock limit down.\n- `high52w` - the highest of the fifty-two weeks.\n- `low52w` - the lowest of the fifty-two weeks.\n- `volume_ratio` - volume ratio.\n- `pe_lyr` - pe lyr.\n- `pe_ttm` - pe ttm.\n- `pe_forecast` - pe forecast.\n- `pb` - price/book value ratio.\n- `eps` - earnings per share.\n- `bps` - net asset value per share.\n- `dividend` - stock dividend.\n- `dividend_yield` - stock dividend yield.\n- `profit` - net profit.\n- `profit_forecast` - profit forecast.\n- `profit_four` - profit last four quarters.\n\nothers\n- `time` - current time. a `Arrow` class object.\n- `posts` - used to the save `Post` object for stock.\n- `followers` - used to the save `User` object for stock's fans.\n- `prousers` - used to the save `User` object for stock's professional users.\n- `popstocks` - pop stocks.\n- `industries` - industry stocks.\n- `history` - stock history.\n\n*Stock object methods:*\n\n- `refresh(dt: dict = {})` - get current stock data and update `self.time`.\n- `get_posts(page: int = 1, count: int = 20, sort: str = \"time\", source: str = \"all\")` - get stock posts and save to `self.posts`.\n - :param `page`: (optional) page number, default is `1`.\n - :param `count`: (optional) the number of results, default is `20`.\n - :param `sort`: (optional) order type, default is `time`.\n - value: `time`\u6700\u65b0, `reply`\u8bc4\u8bba, `relevance`\u9ed8\u8ba4\n - :param `source`: (optional) source of the results, default is `all`.\n - value: `all`, `user`\u8ba8\u8bba, `news`\u65b0\u95fb, `notice`\u516c\u544a, `trans`\u4ea4\u6613\n- `get_followers(page: int = 1, count: int = 15)` - get stock fans and save to `self.followers`.\n - :param `page`: (optional) page number, default is `1`.\n - :param `count`: (optional) the number of results, default is `15`.\n- `get_prousers(count: int = 5)` - get stock professional users and save to `self.prousers`.\n- `get_popstocks(count: int = 8)` - get pop stocks and save to `self.popstocks`.\n- `get_industry_stocks(count: int = 8)` - get industry stocks and save to `self.industries`.\n- `get_histories(begin: str = '-1m', end: str = arrow.now(), period: str = 'day')` - get stock history data and save to `self.history`.\n - :param `begin`: the start date of the results.\n - value: -1w -2w -1m -3m -6m -1y -2y -3y -5y cyear issue or YYYY-MM-DD\n - :param `end`: (optional) the end date of the results, default is `now`.\n - :param `period`: (optional) set date period, default is `day`.\n - value: day week month quarter year 120m 60m 30m 15m 5m 1m\n- `income(quarter: str = 'all', count: int = 12, lang: str = 'cn')` - get stock income sheet.\n- `balance(quarter: str = 'all', count: int = 12, lang: str = 'cn')` - get stock balance sheet.\n- `cash_flow(quarter: str = 'all', count: int = 12, lang: str = 'cn')` - get stock cash flow sheet.\n\nExample:\n```python\n>>> s = Stock(\"SH601318\")\n>>> s.symbol\n\"SH601318\"\n>>> s.name\n\"\u4e2d\u56fd\u5e73\u5b89\"\n>>> s.market_capital\n1119664786363.0\n>>> s.issue_date.format(\"YYYY-MM-DD\")\n\"2007-02-28\"\n>>> s.refresh() # update stock data\n>>> s.get_posts()\n{'count': 188745,\n 'page': 1,\n 'maxpage': 100,\n 'list': [,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ]}\n>>> s.get_popstocks()\n>>> s.popstocks\n[,\n ,\n ,\n ,\n ,\n ,\n ,\n ]\n>>> s.get_industry_stocks()\n>>> s.industries\n{'industryname': '\u975e\u94f6\u91d1\u878d',\n 'list': [,\n ,\n ,\n ,\n ,\n ,\n ,\n ]}\n>>> s.get_histories('2019-01-07','2019-01-11')\n>>> s.history.iloc[:,0:8]\ndate volume open high low close chg percent turnoverrate\n2019-01-07 76593007 57.09 57.17 55.90 56.30 -0.29 -0.51 0.70\n2019-01-08 55992092 56.05 56.09 55.20 55.80 -0.50 -0.89 0.51\n2019-01-09 81914613 56.20 57.60 55.96 56.95 1.15 2.06 0.75\n2019-01-10 67328223 56.87 57.82 56.55 57.50 0.55 0.97 0.61\n2019-01-11 45756973 58.00 58.29 57.50 58.07 0.57 0.99 0.42\n>>> s.history.iloc[:,8:17]\ndate ma5 ma10 ma20 ma30 pe pb ps pcf market_capital\n2019-01-07 55.970 56.885 59.2520 60.7143 10.073 1.949 1.051972 3.536000 1.029178e+12\n2019-01-08 55.910 56.631 58.8920 60.4863 9.984 1.932 1.042629 3.504597 1.020037e+12\n2019-01-09 56.264 56.501 58.6305 60.2780 10.190 1.972 1.064117 3.576824 1.041060e+12\n2019-01-10 56.628 56.430 58.3970 60.0910 10.288 1.991 1.074394 3.611368 1.051114e+12\n2019-01-11 56.924 56.507 58.1775 59.9010 10.390 2.011 1.085044 3.647167 1.061534e+12\n>>> s.get_histories('-1w')\n>>> s.history.iloc[:,0:8]\ndate volume open high low close chg percent turnoverrate\n2019-01-24 44940618 59.61 60.52 59.22 60.43 0.94 1.58 0.41\n2019-01-25 67245911 60.50 61.78 60.43 61.29 0.86 1.42 0.62\n2019-01-28 58164884 61.80 62.41 61.20 61.52 0.23 0.38 0.53\n2019-01-29 39519294 61.38 61.90 60.98 61.65 0.13 0.21 0.36\n2019-01-30 31000323 60.88 61.86 60.78 61.25 -0.40 -0.65 0.27\n>>> s.get_histories('-1y')\n>>> s.history[['pe','pb','ps']].describe()\n pe pb ps\ncount 243.000000 243.000000 243.000000\nmean 11.840588 2.273996 1.217041\nstd 1.357489 0.215217 0.110052\nmin 9.728900 1.911000 1.031044\n25% 10.849450 2.143200 1.150554\n50% 11.504900 2.237300 1.197700\n75% 12.628600 2.345200 1.251150\nmax 15.596700 2.935400 1.559700\n>>> s.income()[['\u51c0\u5229\u6da6','\u8425\u4e1a\u603b\u6536\u5165']]\nreport_name \u51c0\u5229\u6da6 \u8425\u4e1a\u603b\u6536\u5165\n2018Q3 8.948900e+10 7.504560e+11\n2018Q2 6.477000e+10 5.348140e+11\n2018Q1 2.895100e+10 3.104520e+11\n2017Q4 9.997800e+10 8.908820e+11\n...\n>>> s.balance()[['\u8d44\u4ea7\u5408\u8ba1','\u8d1f\u503a\u5408\u8ba1']]\nreport_name \u8d44\u4ea7\u5408\u8ba1 \u8d1f\u503a\u5408\u8ba1\n2018Q3 6.910935e+12 6.260499e+12\n2018Q2 6.851431e+12 6.216339e+12\n2018Q1 6.725766e+12 6.108353e+12\n2017Q4 6.493075e+12 5.905158e+12\n...\n>>> s.cash_flow()['\u7ecf\u8425\u6d3b\u52a8\u73b0\u91d1\u6d41\u91cf\u51c0\u989d']\nreport_name \u7ecf\u8425\u6d3b\u52a8\u73b0\u91d1\u6d41\u91cf\u51c0\u989d\n2018Q3 1.775950e+11\n2018Q2 1.616070e+11\n2018Q1 1.398670e+11\n2017Q4 1.212830e+11\n...\n```\n\n### Fund class\n\nA fund class that contains fund-related methods.\n\n*Fund object attributes:*\n\n- `fund_nav` - fund net value.\n- `fund_nav_guess` - estimate value.\n- `fund_nav_premium` - fund nav premium rate.\n- `fund_history` - fund history.\n- `fund_stocks` - component stocks.\n- `fund_weight` - stocks weight.\n\n*Fund object methods:*\n\n- `get_fund_stocks(year: str = \"\", mouth: str = \"12\")` - get fund's stocks from `\u5929\u5929\u57fa\u91d1`.\n- `get_fund_nav()` - get fund nav.\n- `get_fund_histories(page: int = 1, size: int = 90)` - get history fund nav.\n- `calc_premium()` - calculate fund premium.\n- `refresh_all()` - refresh all of the fund stock objects.\n\nExample:\n```python\n>>> f = Fund('501301')\n>>> f.symbol\n\"SH501301\"\n>>> f.fund_nav\n['2019-01-29', 1.1311, 1.1311, '-0.47%']\n>>> f.get_fund_stocks()\n>>> f.fund_stocks\n stocks weight\n0 \u4e2d\u56fd\u79fb\u52a8[00941] 0.1082\n1 \u5de5\u5546\u94f6\u884c[01398] 0.0975\n2 \u817e\u8baf\u63a7\u80a1[00700] 0.0970\n3 \u5efa\u8bbe\u94f6\u884c[00939] 0.0932\n4 \u4e2d\u56fd\u5e73\u5b89[02318] 0.0922\n5 \u4e2d\u56fd\u94f6\u884c[03988] 0.0642\n6 \u4e2d\u56fd\u6d77\u6d0b\u77f3\u6cb9[00883] 0.0522\n7 \u4e2d\u56fd\u77f3\u5316[00386] 0.0343\n8 \u4e2d\u56fd\u4eba\u5bff[02628] 0.0297\n9 \u62db\u5546\u94f6\u884c[03968] 0.0267\n>>> list(f.fund_stocks.weight)\n[0.1082, 0.0975, 0.097, 0.0932, 0.0922, 0.0642, 0.0522, 0.0343, 0.0297, 0.0267]\n>>> f.get_fund_histories('2019-01-07','2019-01-11')\n>>> f.fund_history\ndate nav cnav percent\n2019-01-07 1.0743 1.0743 0.70\n2019-01-08 1.0679 1.0679 -0.60\n2019-01-09 1.0949 1.0949 2.53\n2019-01-10 1.0944 1.0944 -0.05\n2019-01-11 1.0964 1.0964 0.18\n>>> f.get_fund_histories('-1w')\ndate nav cnav percent\n2019-01-25 1.1413 1.1413 2.02\n2019-01-28 1.1364 1.1364 -0.43\n2019-01-29 1.1311 1.1311 -0.47\n2019-01-30 1.1379 1.1379 0.60\n2019-01-31 1.1475 1.1475 0.84\n```\n\n### get_all_funds function\n\nExample:\n```python\n>>> df = get_all_funds()\n>>> df.groupby(by='type').count()\ntype code name\nETF-\u573a\u5185 171 171\nQDII 171 171\nQDII-ETF 10 10\nQDII-\u6307\u6570 83 83\n\u4fdd\u672c\u578b 52 52\n\u503a\u5238\u578b 1613 1613\n\u503a\u5238\u6307\u6570 69 69\n\u5176\u4ed6\u521b\u65b0 2 2\n\u5206\u7ea7\u6760\u6746 132 132\n\u56fa\u5b9a\u6536\u76ca 132 132\n\u5b9a\u5f00\u503a\u5238 657 657\n\u6df7\u5408-FOF 40 40\n\u6df7\u5408\u578b 3167 3167\n\u7406\u8d22\u578b 116 116\n\u8054\u63a5\u57fa\u91d1 194 194\n\u80a1\u7968\u578b 373 373\n\u80a1\u7968\u6307\u6570 462 462\n\u8d27\u5e01\u578b 665 665\n>>> df[df['code'].str.contains('^510')].head()\n code name type\n7319 510010 \u4ea4\u94f6\u4e0a\u8bc1180\u6cbb\u7406ETF ETF-\u573a\u5185\n7320 510020 \u535a\u65f6\u4e0a\u8bc1\u8d85\u5927\u76d8ETF ETF-\u573a\u5185\n7321 510030 \u534e\u5b9d\u4e0a\u8bc1180\u4ef7\u503cETF ETF-\u573a\u5185\n7322 510050 \u534e\u590f\u4e0a\u8bc150ETF ETF-\u573a\u5185\n7323 510060 \u5de5\u94f6\u4e0a\u8bc1\u592e\u4f0150ETF ETF-\u573a\u5185\n>>> df[df['name'].str.contains('\u6052\u751f')].head()\n code name type\n54 000071 \u534e\u590f\u6052\u751fETF\u8054\u63a5A QDII-\u6307\u6570\n58 000075 \u534e\u590f\u6052\u751fETF\u8054\u63a5\u73b0\u6c47 QDII-\u6307\u6570\n59 000076 \u534e\u590f\u6052\u751fETF\u8054\u63a5\u73b0\u949e QDII-\u6307\u6570\n761 000948 \u534e\u590f\u6caa\u6e2f\u901a\u6052\u751fETF\u8054\u63a5A QDII-\u6307\u6570\n919 001149 \u6c47\u4e30\u664b\u4fe1\u6052\u751f\u9f99\u5934\u6307\u6570C \u80a1\u7968\u6307\u6570\n```\n\n### get_all_funds_ranking function\n\nExample:\n```python\n>>> df = get_all_funds_ranking(fund_type='fof') # \u5f00\u653e\u5f0f\u57fa\u91d1\u6392\u884c\n>>> df.head()[['code','name','issue_date','nav','current_year']]\n code name issue_date nav current_year\n0 005220 \u6d77\u5bcc\u901a\u805a\u4f18\u7cbe\u9009\u6df7\u5408(FOF) 2017-11-06 0.8277 0.050781\n1 006306 \u6cf0\u8fbe\u5b8f\u5229\u6cf0\u548c\u5e73\u8861\u517b\u8001(FOF) 2018-10-25 1.0099 0.020513\n2 006042 \u4e0a\u6295\u6469\u6839\u5c1a\u777f\u6df7\u5408(FOF) 2018-08-15 0.9931 0.011613\n3 005222 \u6cf0\u8fbe\u5b8f\u5229\u5168\u80fd\u6df7\u5408(FOF)C 2017-11-02 0.9803 0.015644\n4 005221 \u6cf0\u8fbe\u5b8f\u5229\u5168\u80fd\u6df7\u5408(FOF)A 2017-11-02 0.9850 0.015883\n>>> df = get_all_funds_ranking(fund_type='ct') # \u573a\u5185\u57fa\u91d1\u6392\u884c\n>>> df.tail()[['code','name','issue_date','nav','-1year','current_year']]\n code name issue_date nav -1year current_year\n419 150197 \u56fd\u6cf0\u56fd\u8bc1\u6709\u8272\u91d1\u5c5e\u884c\u4e1a\u5206\u7ea7B 2015-03-30 0.3411 -0.715443 -0.038349\n420 150294 \u5357\u65b9\u4e2d\u8bc1\u9ad8\u94c1\u4ea7\u4e1a\u6307\u6570\u5206\u7ea7B 2015-06-10 0.4018 -0.543043 -0.057697\n421 150308 \u5bcc\u56fd\u4e2d\u8bc1\u4f53\u80b2\u4ea7\u4e1a\u6307\u6570\u5206\u7ea7B 2015-06-25 0.8470 -0.663614 -0.055753\n422 150264 \u534e\u5b9d\u4e2d\u8bc11000\u6307\u6570\u5206\u7ea7B 2015-06-04 0.3436 -0.661696 0.031840\n423 512590 \u6d66\u94f6\u5b89\u76db\u4e2d\u8bc1\u9ad8\u80a1\u606fETF 2019-01-29 1.0032 NaN NaN\n```\n\n### get_economic function\n\nExample:\n```python\n>>> get_economic() # \u83b7\u53d6\u7ecf\u6d4e\u6307\u6807\n{'\u4e2d\u56fd\u4eba\u6c11\u94f6\u884c\u5229\u7387': '1083',\n '\u4e2d\u56fd\u5b63\u5ea6\u56fd\u5185\u751f\u4ea7\u603b\u503c(GDP)\u5e74\u7387': '461',\n '\u4e2d\u56fd\u89c4\u6a21\u4ee5\u4e0a\u5de5\u4e1a\u589e\u52a0\u503c\u5e74\u7387': '462',\n '\u4e2d\u56fd\u5b98\u65b9\u5236\u9020\u4e1a\u91c7\u8d2d\u7ecf\u7406\u4eba\u6307\u6570(PMI)': '594',\n '\u4e2d\u56fd\u8d22\u65b0\u5236\u9020\u4e1a\u91c7\u8d2d\u7ecf\u7406\u4eba\u6307\u6570(PMI)': '753',\n '\u4e2d\u56fd\u5931\u4e1a\u7387': '1793',\n '\u4e2d\u56fd\u8d38\u6613\u5e10 (\u7f8e\u5143)': '466',\n '\u4e2d\u56fd\u53f0\u6e7e\u5229\u7387\u51b3\u8bae': '1117',\n......\n>>> get_economic(search='\u7f8e\u56fd') # \u83b7\u53d6\u7ecf\u6d4e\u6307\u6807 - \u7f8e\u56fd\n{'\u7f8e\u56fd\u5931\u4e1a\u7387': '300',\n '\u7f8e\u56fd\u603b\u7edf\u9009\u4e3e': '371',\n '\u7f8e\u56fdADP\u5c31\u4e1a\u4eba\u6570': '1',\n '\u7f8e\u56fdISM\u5236\u9020\u4e1aPMI': '173',\n '\u7f8e\u56fd\u96f6\u552e\u9500\u552e\u6708\u7387': '256',\n '\u7f8e\u56fd\u8425\u5efa\u8bb8\u53ef\u603b\u6570': '25',\n '\u7f8e\u56fdISM\u975e\u5236\u9020\u4e1aPMI': '176',\n '\u7f8e\u56fd\u6838\u5fc3\u96f6\u552e\u9500\u552e\u6708\u7387': '63',\n......\n>>> df = get_economic('\u4e2d\u56fd\u8d22\u65b0\u5236\u9020\u4e1a\u91c7\u8d2d\u7ecf\u7406\u4eba\u6307\u6570(PMI)') # \u83b7\u53d6\u8d22\u65b0PMI\n>>> df.tail()\ndate actual actual_state forecast revised\n2018-09-30 50.0 down 50.5 NaN\n2018-11-01 50.1 up 49.9 NaN\n2018-12-03 50.2 up 50.1 NaN\n2019-01-02 49.7 down 50.3 NaN\n2019-02-01 48.3 down 49.5 NaN\n>>> df.to_excel('output.xls') # \u5bfc\u51faexcel\n```\n\n### get_economic_of_china function\n\nExample:\n```python\n>>> get_economic_of_china(search='\u603b\u4eba\u53e3')\n[{'id': 'A01050201', 'name': '\u6c11\u65cf\u81ea\u6cbb\u5730\u65b9\u603b\u4eba\u53e3\u6570'},\n {'id': 'A030301', 'name': '\u5e74\u672b\u603b\u4eba\u53e3'},\n {'id': 'A030501', 'name': '\u4eba\u53e3\u666e\u67e5\u603b\u4eba\u53e3'},\n {'id': 'A030508', 'name': '\u4eba\u53e3\u666e\u67e50-14\u5c81\u4eba\u53e3\u5360\u603b\u4eba\u53e3\u6bd4\u91cd'},\n......\n>>> df = get_economic_of_china('A030101,A030102,A030103', time_period='1949-')\n>>> df.to_period('A').tail()\n \u5e74\u672b\u603b\u4eba\u53e3 \u7537\u6027\u4eba\u53e3 \u5973\u6027\u4eba\u53e3\n1953 58796.0 30468.0 28328.0\n1952 57482.0 29833.0 27649.0\n1951 56300.0 29231.0 27069.0\n1950 55196.0 28669.0 26527.0\n1949 54167.0 28145.0 26022.0\n>>> get_economic_of_china(category='month', search='\u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570')\n[{'id': 'A01010101', 'name': '\u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570(\u4e0a\u5e74\u540c\u6708=100)'},\n {'id': 'A01010102', 'name': '\u98df\u54c1\u70df\u9152\u7c7b\u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570(\u4e0a\u5e74\u540c\u6708=100)'},\n {'id': 'A01010103', 'name': '\u8863\u7740\u7c7b\u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570(\u4e0a\u5e74\u540c\u6708=100)'},\n {'id': 'A01010104', 'name': '\u5c45\u4f4f\u7c7b\u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570(\u4e0a\u5e74\u540c\u6708=100)'},\n......\n>>> get_economic_of_china(\"A01010101\", category='month').to_period('M')\n \u5c45\u6c11\u6d88\u8d39\u4ef7\u683c\u6307\u6570(\u4e0a\u5e74\u540c\u6708=100)\n2018-12 101.860698\n2018-11 102.175041\n2018-10 102.543151\n2018-09 102.472394\n......\n>>> get_economic_of_china(category='month_by_state', search='region')\n[{'id': '110000', 'name': '\u5317\u4eac\u5e02'},\n {'id': '120000', 'name': '\u5929\u6d25\u5e02'},\n {'id': '130000', 'name': '\u6cb3\u5317\u7701'},\n {'id': '140000', 'name': '\u5c71\u897f\u7701'},\n......\n>>> get_economic_of_china(\"A03010101\", region='210000,130000', category='month_by_state').to_period('M')\n \u8fbd\u5b81\u7701 \u6cb3\u5317\u7701\n2018-12 333.6 381.0\n2018-11 311.0 398.3\n2018-10 274.3 429.2\n2018-09 273.5 456.2\n......\n```\n\n### get_data_invest function\n\nExample:\n```python\n>>> get_data_invest(query='BABA')\n[['941155', '\u963f\u91cc\u5df4\u5df4', 'BABA', '\u7ebd\u7ea6'],\n ['940993', 'Baba Farid Sugar Mills Ltd', 'BABA', '\u5df4\u57fa\u65af\u5766\u5361\u62c9\u5947'],\n ['986306', '\u963f\u91cc\u5df4\u5df4', 'BABAUSD', '\u745e\u58eb'],\n ['987353', 'Baba Arts Ltd', 'BART', '\u5b5f\u4e70BSE'],\n>>> get_data_invest('941155', '-1y').head()\ndate close open high low vol\n2018-03-05 181.60 179.41 181.95 177.07 15656661.0\n2018-03-06 187.37 185.19 188.01 184.82 17856088.0\n2018-03-07 189.05 184.37 189.07 184.32 13728910.0\n2018-03-08 187.18 189.05 190.23 186.57 14331400.0\n2018-03-09 190.55 189.64 190.70 188.01 14208356.0\n```\n\n### get_data_yahoo function\n\nExample:\n```python\n>>> get_data_yahoo('BABA', '-1y').head()\nDate High Low Open Close Volume Adj Close\n2018-02-22 190.740005 187.770004 190.199997 188.750000 12282800 188.750000\n2018-02-23 193.404999 189.949997 190.179993 193.289993 16937300 193.289993\n2018-02-26 195.149994 190.649994 194.460007 194.190002 19463100 194.190002\n2018-02-27 193.567001 187.210007 192.589996 188.259995 23218500 188.259995\n2018-02-28 188.240005 185.000000 187.250000 186.139999 19367600 186.139999\n```\n\n### get_quota_yahoo function\n\nExample:\n```python\n>>> get_quote_yahoo('BABA')[['marketCap','price']]\n marketCap price\nBABA 458608476160 176.92\n```\n\n### get_stock_margin function\n\nExample:\n```python\n>>> get_stock_margin()[['\u6536\u76d8-\u6caa\u6df1300','\u6da8\u8dcc\u5e45','\u878d\u8d44\u4f59\u989d','\u878d\u8d44\u51c0\u4e70\u5165\u989d']]\ntdate \u6536\u76d8-\u6caa\u6df1300 \u6da8\u8dcc\u5e45 \u878d\u8d44\u4f59\u989d \u878d\u8d44\u51c0\u4e70\u5165\u989d\n2019-02-21 3442.7056 -0.267146 751770477596 3751230646\n2019-02-20 3451.9273 0.358166 748019246950 4533629289\n2019-02-19 3439.6078 -0.178104 743485617661 5998280511\n2019-02-18 3445.7448 3.206037 737487337150 5113256902\n...\n>>> get_stock_margin(mkt_type='sh')[['\u6536\u76d8-\u6caa\u6df1300','\u6da8\u8dcc\u5e45','\u878d\u8d44\u4f59\u989d','\u878d\u8d44\u51c0\u4e70\u5165\u989d']]\ntdate \u6536\u76d8-\u6caa\u6df1300 \u6da8\u8dcc\u5e45 \u878d\u8d44\u4f59\u989d \u878d\u8d44\u51c0\u4e70\u5165\u989d\n2019-02-22 2804.2262 1.905116 461954859629 2720050470\n2019-02-21 2751.8012 -0.341070 459234809159 2049990278\n2019-02-20 2761.2189 0.202239 457184818881 1992074891\n2019-02-19 2755.6459 0.046809 455192743990 3286343033\n...\n>>> get_stock_margin(code='601318')[['\u6536\u76d8-\u6caa\u6df1300','\u6da8\u8dcc\u5e45','\u878d\u8d44\u4f59\u989d','\u878d\u8d44\u51c0\u4e70\u5165\u989d']]\ntdate \u6536\u76d8-\u6caa\u6df1300 \u6da8\u8dcc\u5e45 \u878d\u8d44\u4f59\u989d \u878d\u8d44\u51c0\u4e70\u5165\u989d\n2019-02-22 67.02 2.4927 19272743520 -159641891\n2019-02-21 65.39 -0.7438 19432385411 -50054160\n2019-02-20 65.88 0.3045 19482439571 12374039\n2019-02-19 65.68 0.5973 19470065532 169750461\n```\n\n### get_hsgt_history function\n\nExample:\n```python\n>>> shgt = get_hsgt_history(mkt_type='shgt', begin='-1m') # \u6caa\u80a1\u901a(\u5317) \u8fd11\u6708\n>>> shgt[['\u5f53\u65e5\u8d44\u91d1\u6d41\u5165','\u5f53\u65e5\u4f59\u989d','\u5f53\u65e5\u6210\u4ea4\u51c0\u4e70\u989d','\u9886\u6da8\u80a1','\u6307\u6570','\u6da8\u8dcc\u5e45']]\nDetailDate \u5f53\u65e5\u8d44\u91d1\u6d41\u5165 \u5f53\u65e5\u4f59\u989d \u5f53\u65e5\u6210\u4ea4\u51c0\u4e70\u989d \u9886\u6da8\u80a1 \u6307\u6570 \u6da8\u8dcc\u5e45\n2019-02-22 3965.00 48035.00 3589.82 \u534e\u5b89\u8bc1\u5238 2804.23 0.019053\n2019-02-21 1718.56 50281.44 1473.51 \u8c6b\u5149\u91d1\u94c5 2751.80 -0.003412\n2019-02-20 3228.57 48771.43 2933.49 \u9f0e\u7acb\u80a1\u4efd 2761.22 0.002021\n2019-02-19 1418.11 50581.89 1259.40 \u5b8f\u56fe\u9ad8\u79d1 2755.65 0.000468\n...\n>>> hksh = get_hsgt_history(mkt_type='hksh', begin='-1m') # \u6e2f\u80a1\u901a(\u6caa) \u8fd11\u6708\n>>> hksh[['\u5f53\u65e5\u8d44\u91d1\u6d41\u5165','\u5f53\u65e5\u4f59\u989d','\u5f53\u65e5\u6210\u4ea4\u51c0\u4e70\u989d','\u9886\u6da8\u80a1','\u6307\u6570','\u6da8\u8dcc\u5e45']]\nDetailDate \u5f53\u65e5\u8d44\u91d1\u6d41\u5165 \u5f53\u65e5\u4f59\u989d \u5f53\u65e5\u6210\u4ea4\u51c0\u4e70\u989d \u9886\u6da8\u80a1 \u6307\u6570 \u6da8\u8dcc\u5e45\n2019-02-22 798 41202 186.64 \u534e\u8679\u534a\u5bfc\u4f53 28816.30 0.006510\n2019-02-21 -581 42581 -1122.04 \u5357\u4eac\u718a\u732b 28629.92 0.004064\n2019-02-20 -599 42599 -1166.03 \u4e2d\u56fd\u71c3\u6c14 28514.05 0.010129\n2019-02-19 -741 42741 -1223.02 \u5609\u91cc\u7269\u6d41 28228.13 -0.004194\n...\n```\n\n### get_hsgt_top10 function\n\nExample:\n```python\n>>> get_hsgt_top10(mkt_type='shgt',date='2019-02-22') # \u6caa\u80a1\u901a\u6210\u4ea4\u989dtop10\nRank Code Name Close ChangePercent HGTJME HGTMRJE HGTMCJE HGTCJJE\n1 601318 \u4e2d\u56fd\u5e73\u5b89 67.02 2.4927 353346111 738675531 385329420 1124004951\n2 600030 \u4e2d\u4fe1\u8bc1\u5238 22.43 10.0049 -207273453 319115930 526389383 845505313\n3 600519 \u8d35\u5dde\u8305\u53f0 726.01 0.7997 254156043 448239518 194083475 642322993\n4 600036 \u62db\u5546\u94f6\u884c 30.63 1.8285 346146568 402323371 56176803 458500174\n...\n```\n\n### get_hsgt_holding function\n\nExample:\n```python\n>>> hold = get_hsgt_holding(mkt_type='north', date='2019-02-22') # \u5317\u5411\u6301\u80a1\n>>> hold[['\u4ee3\u7801','\u540d\u79f0','\u6301\u80a1\u5e02\u503c','\u6301\u80a1\u6570\u91cf','\u6301\u80a1\u5360A\u80a1\u6bd4\u4f8b']]\nHDDATE \u4ee3\u7801 \u540d\u79f0 \u6301\u80a1\u5e02\u503c \u6301\u80a1\u6570\u91cf \u6301\u80a1\u5360A\u80a1\u6bd4\u4f8b\n2019-02-22 600519 \u8d35\u5dde\u8305\u53f0 8.517306e+10 117316644 9.18\n2019-02-22 601318 \u4e2d\u56fd\u5e73\u5b89 5.141756e+10 767197321 6.85\n2019-02-22 000333 \u7f8e\u7684\u96c6\u56e2 4.714754e+10 1033710522 15.52\n2019-02-22 600276 \u6052\u745e\u533b\u836f 3.194746e+10 481862195 12.95\n...\n>>> hold = get_hsgt_holding(code='601318', date='2019-02-22') # \u4e2a\u80a1\u6301\u80a1\uff0c\u6700\u591a\u8fd11\u6708\u6570\u636e\n>>> hold[['\u4ee3\u7801','\u540d\u79f0','\u6301\u80a1\u5e02\u503c','\u6301\u80a1\u6570\u91cf','\u6301\u80a1\u5360A\u80a1\u6bd4\u4f8b']]\nHDDATE \u4ee3\u7801 \u540d\u79f0 \u6301\u80a1\u5e02\u503c \u6301\u80a1\u6570\u91cf \u6301\u80a1\u5360A\u80a1\u6bd4\u4f8b\n2019-02-22 601318 \u4e2d\u56fd\u5e73\u5b89 5.141756e+10 767197321 6.85\n2019-02-21 601318 \u4e2d\u56fd\u5e73\u5b89 4.981185e+10 761765628 6.80\n2019-02-20 601318 \u4e2d\u56fd\u5e73\u5b89 4.991939e+10 757732051 6.80\n2019-02-19 601318 \u4e2d\u56fd\u5e73\u5b89 4.943077e+10 752600092 6.72\n...\n```\n\n### BaiduIndex class\n\nExample:\n```python\n>>> BaiduIndex.cookie = \"cookie string\" # OR load cookie from browsers\n>>> idx = BaiduIndex()\n>>> idx.search('\u80a1\u7968,\u57fa\u91d1', begin='-3m', area='\u4e0a\u6d77').tail()\ndate \u80a1\u7968 \u57fa\u91d1\n2019-02-18 1722 778\n2019-02-19 2117 837\n2019-02-20 1879 782\n2019-02-21 1933 760\n2019-02-22 2097 779\n>>> idx.search('\u80a1\u7968,\u57fa\u91d1', begin='-2q', index='feed', area='\u5e7f\u5dde').head()\ndate \u80a1\u7968 \u57fa\u91d1\n2018-08-23 221807 16838\n2018-08-24 196099 11339\n2018-08-25 185960 16346\n2018-08-26 137134 12206\n2018-08-27 180028 28195\n>>> idx.region_distribution('\u80a1\u7968', '-6w') # \u5730\u57df\u5206\u5e03\n{\n '\u80a1\u7968': {\n 'city': {'514': 1000, '57': 962, '138': 677, '94': 663, ....},\n 'prov': {'913': 1000, '917': 693, '916': 555, '911': 498, ....},\n 'period': '2019-01-23|2019-02-22'\n }\n}\n>>> idx.social_attribute('\u80a1\u7968', '-15d') # \u4eba\u7fa4\u5c5e\u6027\n{\n '\u80a1\u7968': {\n 'age': {'1': '2', '2': '11', '3': '45', '4': '32', '5': '10'},\n 'sex': {'F': '23', 'M': '77'}\n }\n}\n```\n\n### search function\n\n- `search(query: str = \"\", query_type: str = \"stock\", symbol: str = \"\", count: int = 10, page: int = 1, sort: str = \"time\", source: str = \"user\")` - Sends a search request.\n - :param `query`: query string.\n - :param `query_type`: (optional) type of the query request, default is `stock`.\n - value: stock, post, user\n - :param `symbol`: (optional) the stock symbol.\n - :param `count`: (optional) the number of results, default is `20`.\n - :param `page`: (optional) page number, default is `1`.\n - :param `sort`: (optional) order type, default is `time`.\n - value: time\u6700\u65b0, reply\u8bc4\u8bba, relevance\u9ed8\u8ba4\n - :param `source`: (optional) source of the results, default is `user`.\n - value: all, user\u8ba8\u8bba, news\u65b0\u95fb, notice\u516c\u544a, trans\u4ea4\u6613\n - :return: a list of :class:`Object ` objects. Object class: Stock, Post or User\n - :rtype: list([ins1, ins2, ...])\n\n### news function\n\n- `news(category: int = -1, count: int = 10, max_id: int = -1)` - Get news.\n - :param `category`: (optional) type of the news, default is `-1`.\n - value: \u5934\u6761-1, \u4eca\u65e5\u8bdd\u98980, \u76f4\u64ad6, \u6caa\u6df1105, \u6e2f\u80a1102, \u7f8e\u80a1101, \u57fa\u91d1104, \u79c1\u52df113, \u623f\u4ea7111, \u6c7d\u8f66114, \u4fdd\u9669110\n - :param `count`: (optional) the number of results, default is `10`.\n - :param `max_id`: (optional) the max id of news, default is `-1`.\n - :return: a list of :class:`Post ` objects.\n - :rtype: list([post1, post2, ...])\n\n### utils module\n\nThis module contains some utils.\n\n- `get_cookies()` - load cookies from local file, browser and selenium. return a `LWPCookieJar` class object.\n- `get_session()` - get the requests session.\n- `clean_html(tree: str)` - clean html.\n- `check_symbol(code: str)` - check stock symbol.\n- `exrate(date: str = \"\", code: str = \"USD\")` - get the monetary exchange rate by date.\n - code: \n```python\n{'USD':'\u7f8e\u5143','EUR':'\u6b27\u5143','JPY':'\u65e5\u5143','HKD':'\u6e2f\u5143','GBP':'\u82f1\u9551','AUD':'\u6fb3\u5927\u5229\u4e9a\u5143',\n 'NZD':'\u65b0\u897f\u5170\u5143','SGD':'\u65b0\u52a0\u5761\u5143','CHF':'\u745e\u58eb\u6cd5\u90ce','CAD':'\u52a0\u62ff\u5927\u5143','MYR':'\u9a6c\u6765\u897f\u4e9a\u6797\u5409\u7279',\n 'RUB':'\u4fc4\u7f57\u65af\u5362\u5e03','ZAR':'\u5357\u975e\u5170\u7279','KRW':'\u97e9\u5143','AED':'\u963f\u8054\u914b\u8fea\u62c9\u59c6','SAR':'\u6c99\u7279\u91cc\u4e9a\u5c14',\n 'HUF':'\u5308\u7259\u5229\u798f\u6797','PLN':'\u6ce2\u5170\u5179\u7f57\u63d0','DKK':'\u4e39\u9ea6\u514b\u6717','SEK':'\u745e\u5178\u514b\u6717','NOK':'\u632a\u5a01\u514b\u6717',\n 'TRY':'\u571f\u8033\u5176\u91cc\u62c9','MXN':'\u58a8\u897f\u54e5\u6bd4\u7d22','THB':'\u6cf0\u94e2'}\n```\n- `exusd(date: str = \"\")` - only for `USD`.\n- `exhkd(date: str = \"\")` - only for `HKD`.\n\nExample:\n```python\n>>> CJ = get_cookies()\n>>> sess = get_session()\n>>> clean_html(\"hello.\")\nhello.\n>>> check_symbol(601318)\n\"SH601318\"\n>>> exrate(\"2019-01-10\", \"EUR\")\n[7.8765, 7.8443]\n>>> exusd(date=\"2019-01-10\")\n[6.816, 6.8526]\n>>> exhkd(\"2019-01-10\")\n[0.86959, 0.87419]\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/1dot75cm/xueqiu", "keywords": "xueqiu,snowball,stock,api,api client,wrappers", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "xueqiu", "package_url": "https://pypi.org/project/xueqiu/", "platform": "any", "project_url": "https://pypi.org/project/xueqiu/", "project_urls": { "Homepage": "https://github.com/1dot75cm/xueqiu" }, "release_url": "https://pypi.org/project/xueqiu/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "A humanize XueQiu API wrappers.", "version": "0.1.5" }, "last_serial": 5139208, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c74edde111e360f6de84a18148d90167", "sha256": "0a7d0eb1dbd2a943c82b77045e51c03c38d1608d80e1123e2b4a8045c0e155b6" }, "downloads": -1, "filename": "xueqiu-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c74edde111e360f6de84a18148d90167", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16190, "upload_time": "2019-01-29T16:08:22", "url": "https://files.pythonhosted.org/packages/4d/a2/f938e2007767ddbd9ab1abc4264be7176b87685b7dbd9205c662a61b33f7/xueqiu-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b84e5a4514088e7f4ae796e7cf6a84f7", "sha256": "98ea7a0b18e4e92c40fdc9f67b8e05735378538aef28c800b1c09543d8a2b99c" }, "downloads": -1, "filename": "xueqiu-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b84e5a4514088e7f4ae796e7cf6a84f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15578, "upload_time": "2019-01-29T16:08:25", "url": "https://files.pythonhosted.org/packages/5b/cc/e14cfada7ce32bbd2ff03dab59c24d06dd62500bdba7de0901dcea811e5a/xueqiu-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "201a6a541218c76045e4d1bc8840368b", "sha256": "115576735c03ad81926176e3e99f842446fdefd7f3fdf18d7312e0770bc6dc65" }, "downloads": -1, "filename": "xueqiu-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "201a6a541218c76045e4d1bc8840368b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23623, "upload_time": "2019-01-30T11:35:04", "url": "https://files.pythonhosted.org/packages/f6/3a/5cdab27cacda78c241d542ae7b8bbe6f301d033f5e87c640ba6aebe4cb1d/xueqiu-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c7ebb438e633490572dc1992a7bd619", "sha256": "59b366b8729591feeeac616561e529383537c1ab63f1985ea075f60f498902a0" }, "downloads": -1, "filename": "xueqiu-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2c7ebb438e633490572dc1992a7bd619", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30675, "upload_time": "2019-01-30T11:35:06", "url": "https://files.pythonhosted.org/packages/99/ec/5659321696f38646a392aac3d743a607a76a3d2e85c4f07d115d33222c16/xueqiu-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7635cec96442429e730e72954b5e2f6a", "sha256": "b6a5371aac71044dd0277fcb64fb852e1fb65798517b6f9dd6d4f08c7680df17" }, "downloads": -1, "filename": "xueqiu-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7635cec96442429e730e72954b5e2f6a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30528, "upload_time": "2019-02-13T10:10:20", "url": "https://files.pythonhosted.org/packages/5b/fc/73b87e0b23dffa63c8653f000ab6cedf003f45bcdbb0331c9aebe24ce351/xueqiu-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "551144bebd6f872139cdd713ed9d4fc4", "sha256": "8ff278d72536ad8a33a5c2af03a5a9d39fba3e4d6a3005469ffa368585004b95" }, "downloads": -1, "filename": "xueqiu-0.1.2.tar.gz", "has_sig": false, "md5_digest": "551144bebd6f872139cdd713ed9d4fc4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44298, "upload_time": "2019-02-13T10:10:22", "url": "https://files.pythonhosted.org/packages/3e/ab/1b0d6f653f08465d3638edffc528471036b290279f8a1e1d4382747ed442/xueqiu-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3aaf691f3ad9ebaeb6ef99777be01303", "sha256": "c55e2d7f537e8305de6a8b7e347518feae540b7670c5e3e3d42447b8e00f5853" }, "downloads": -1, "filename": "xueqiu-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "3aaf691f3ad9ebaeb6ef99777be01303", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53366, "upload_time": "2019-02-25T18:14:08", "url": "https://files.pythonhosted.org/packages/06/b0/52211ab955f86f48ac2c2f83858063aa8c137a886f3f584e4a127dc53e72/xueqiu-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3006e9f202fdfca2d67545a7ffc71cf", "sha256": "b50c726eb4e6957d63b0be70d3964412f31bd90d266814592e90475eca513cd5" }, "downloads": -1, "filename": "xueqiu-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b3006e9f202fdfca2d67545a7ffc71cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75125, "upload_time": "2019-02-25T18:14:11", "url": "https://files.pythonhosted.org/packages/3f/68/0b0c36e71543014958499a492374fe69cfee0a7b51e59f3c31b144a4ce48/xueqiu-0.1.3.tar.gz" } ], "0.1.3.1": [ { "comment_text": "", "digests": { "md5": "cb916f1a89891195cf10e966ec1ec96f", "sha256": "8d918be8704e64d502cbc37e8bbf2191535b6734973d1c7d407b29542a8a77ac" }, "downloads": -1, "filename": "xueqiu-0.1.3.1.tar.gz", "has_sig": false, "md5_digest": "cb916f1a89891195cf10e966ec1ec96f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75219, "upload_time": "2019-02-27T11:42:07", "url": "https://files.pythonhosted.org/packages/4b/2e/00b8c329e95dd45dcb0969ff62c93e84809034910f0c61da80cabd457808/xueqiu-0.1.3.1.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "d66754f551a4dffa522a834e2d290671", "sha256": "39a56dfa48a313354c8db6bc918b7e51a5d1c0bf36d8e08269d91fc59c69fe5f" }, "downloads": -1, "filename": "xueqiu-0.1.5.tar.gz", "has_sig": false, "md5_digest": "d66754f551a4dffa522a834e2d290671", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1431342, "upload_time": "2019-04-13T21:31:13", "url": "https://files.pythonhosted.org/packages/fd/d1/f33598490c413bb2a2b6afe4d96415657d2667fbadabd3ed4195460ea4ac/xueqiu-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d66754f551a4dffa522a834e2d290671", "sha256": "39a56dfa48a313354c8db6bc918b7e51a5d1c0bf36d8e08269d91fc59c69fe5f" }, "downloads": -1, "filename": "xueqiu-0.1.5.tar.gz", "has_sig": false, "md5_digest": "d66754f551a4dffa522a834e2d290671", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1431342, "upload_time": "2019-04-13T21:31:13", "url": "https://files.pythonhosted.org/packages/fd/d1/f33598490c413bb2a2b6afe4d96415657d2667fbadabd3ed4195460ea4ac/xueqiu-0.1.5.tar.gz" } ] }