forked from hongtaocai/googlefinance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
76 lines (62 loc) · 1.84 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
googlefinance
=============
Python module to get stock data from Google Finance API
This module provides **no delay**, **real time** stock data in NYSE &
NASDAQ.
Another awesome module,
`yahoo-finance <https://github.com/lukaszbanasiak/yahoo-finance>`__'s
data is delayed by 15 min, but it provides convenient apis to fetch
historical day-by-day stock data.
Install
-------
From PyPI with pip:
::
$pip install googlefinance
From development repo (requires git)
::
$git clone https://github.com/hongtaocai/googlefinance.git
$cd googlefinance
$python setup.py install
Usage example
-------------
::
>>> 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"
}
]