python模块从google finance api获取实时(无延迟)股票数据

googlefinance的Python项目详细描述


从google finance api获取股票数据的python模块

本模块提供无延迟实时纽交所股票数据; 纳斯达克。

又一个很棒的模块, yahoo-finance的 数据延迟15分钟,但它提供了方便的api来获取 历史逐日股价数据。

安装

来自带有pip的pypi:

$pip install googlefinance

来自开发回购(需要git)

$git clone https://github.com/hongtaocai/googlefinance.git
$cd googlefinance
$python setup.py install

用法示例

>>> from googlefinance import getQuotes
>>> import json
>>> print json.dumps(getQuotes('AAPL'), indent=2)
[
  {
    "Index": "NASDAQ",
    "LastTradeWithCurrency": "129.09",
    "LastTradeDateTime": "2015-03-02T16:04:29Z",
    "LastTradePrice": "129.09",
    "Yield": "1.46",
    "LastTradeTime": "4:04PM EST",
    "LastTradeDateTimeLong": "Mar 2, 4:04PM EST",
    "Dividend": "0.47",
    "StockSymbol": "AAPL",
    "ID": "22144"
  }
]
>>> print json.dumps(getQuotes(['AAPL', 'VIE:BKS']), indent=2)
[
  {
    "Index": "NASDAQ",
    "LastTradeWithCurrency": "129.36",
    "LastTradeDateTime": "2015-03-03T16:02:36Z",
    "LastTradePrice": "129.36",
    "LastTradeTime": "4:02PM EST",
    "LastTradeDateTimeLong": "Mar 3, 4:02PM EST",
    "StockSymbol": "AAPL",
    "ID": "22144"
  },
  {
    "Index": "VIE",
    "LastTradeWithCurrency": "17.10",
    "LastTradeDateTime": "2015-03-03T13:30:30Z",
    "LastTradePrice": "17.10",
    "LastTradeTime": "1:30PM GMT+1",
    "LastTradeDateTimeLong": "Mar 3, 1:30PM GMT+1",
    "StockSymbol": "BKS",
    "ID": "978541942832888"
  }
]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java提供了大量的Quartz工作线程   来自SOAPException的java抛出超时异常   java通过REST web服务同步PostgreSQL过程调用   java Hibernate:在关联表中设置值   javaimapidlechanneladapterjavax。邮政AuthenticationFailedException:[警报]同时连接太多   JavaApacheStorm:stormkafkamonitor脚本引发异常   java将jar链接到战争   Matlab与Java的集成方法   安卓公司。谷歌。ads.AdView未能实例化java。lang.ClassNotFoundException:org。json。JSONException   “String forecastStr=mForecastAdapter.getItem(position);”行中出现java错误阳光工程   java如何将Mono中的列表属性作为流量进行操作?   java DecimalFormat类不必要地给出整数   java@IfProfileValue两个spring配置文件   java如何使用SwingWorker创建多线程?   java从扩展SwingWorker的内部类触发事件   java二叉树高度实现