Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hph/stocks

Get current stock quotes and other information.
https://github.com/hph/stocks

Last synced: 3 months ago
JSON representation

Get current stock quotes and other information.

Awesome Lists containing this project

README

        

Stocks
======
Check stock quotes, monitor trends, analyze your portfolio.

Setup
-----
### Installing manually (Linux)

No install required or available at this point.

Usage example
-------------

To get some data for AAPL (Apple Inc.), you could enter the following command:

$ python stocks.py aapl sl1p2mwt8

On March 20 2012 this command returned:

Symbol: AAPL
Last trade: 605.96
Change: +0.81%
Day's range: 582.00 - 606.90
52-week range: 310.50 - 601.77
52-week target estimate: 627.04

After the filename you have to enter the stock symbol or symbols and then the
options. If there is more than one symbol, they have to be separated by "+"
signs (see the example below). The "s" in sl1p2mwt8 stands for symbol. The "l1"
stands for last trade. For a full list of options, see the Options section.
Another example, now with two symbols, AAPL and MSFT (Microsoft Corporation):

$ python stocks.py aapl+msft sl1p2mwt8

On March 20 2012 this command returned:

Symbol: AAPL
Last trade: 605.96
Change: +0.81%
Day's range: 582.00 - 606.90
52-week range: 310.50 - 601.77
52-week target estimate: 627.04

Symbol: MSFT
Last trade: 31.99
Change: -0.65%
Day's range: 31.74 - 32.15
52-week range: 23.65 - 32.95
52-week target estimate: 33.23

To do
-----

+ Historical data and personal portfolio graphs (matplotlib)
+ Cross-platform e-mail and desktop notifications
+ Initial setup command to configure a portfolio
+ Modify the way the program is used but keep the current commands optional
+ Use optparser for option parsing
+ Modify the way the stock data is printed, use more than one column

And more.

Options
-------

A list of options is available via the `options` parameter:

python stocks.py options

Which prints a list with the following data:

a
Ask
a2
Average daily volume
a5
Ask size

b
Bid
b2
Ask (real-time)
b3
Bid (real-time)

b4
Book value
b6
Bid size
c
Change & percent change

c1
Change
c3
Commission
c6
Change (real-time)

c8
After hours change (real-time)
d
Dividend/share
d1
Last trade date

d2
Trade date
e
Earnings/share
e1
Error indication (returned for symbol changed or invalid)

e7
EPS estimate current year
e8
EPS estimate next year
e9
EPS estimate next quarter

f6
Float shares
g
Day's low
h
Day's high

j
52-week low
k
52-week high
g1
Holdings gain percent

g3
Annualized gain
g4
Holdings gain
g5
Holdings gain percent (real-time)

g6
Holdings gain (real-time)
i
More info
i5
Order book (real-time)

j1
Market capitalization
j3
Market capitalization (real-time)
j4
EBITDA

j5
Change from 52-week low
j6
Percent change from 52-week low
k1
Last trade (real-time) with time

k2
Change percent (real-time)
k3
Last trade size
k4
Change from 52-week high

k5
Percent change from 52-week high
l
Last trade (with time)
l1
Last trade (price only)

l2
High limit
l3
Low limit
m
Day's range

m2
Day's range (real-time)
m3
50-day moving average
m4
200-day moving average

m5
Change from 200-day moving average
m6
Percent change from 200-day moving average
m7
Change from 50-day moving average

m8
Percent change from 50-day moving average
n
Name
n4
Notes

o
Open
p
Previous close
p1
Price paid

p2
Change in percent
p5
Price/sales
p6
Price/book

q
Ex-dividend date
r
P/E ratio
r1
Dividend pay date

r2
P/E ratio (real-time)
r5
PEG ratio
r6
Price/EPS estimate current year

r7
Price/EPS estimate next year
s
Symbol
s1
Shares owned

s7
Short ratio
t1
Last trade time
t6
Trade links

t7
Ticker trend
t8
1 year target estimate
v
Volume

v1
Holding's value
v7
Holding's value (real-time)
w
52-week range

w1
Day's value change
w4
Day's value change (real-time)
x
Stock exchange

y
Dividend & yield