Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/hph/stocks
- Owner: hph
- Created: 2012-03-19T00:02:00.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-01-14T06:45:41.000Z (almost 8 years ago)
- Last Synced: 2024-10-10T20:20:27.939Z (3 months ago)
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 6
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.04After 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.04Symbol: 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.23To 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 columnAnd 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 sizeb
Bid
b2
Ask (real-time)
b3
Bid (real-time)b4
Book value
b6
Bid size
c
Change & percent changec1
Change
c3
Commission
c6
Change (real-time)c8
After hours change (real-time)
d
Dividend/share
d1
Last trade dated2
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 quarterf6
Float shares
g
Day's low
h
Day's highj
52-week low
k
52-week high
g1
Holdings gain percentg3
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
EBITDAj5
Change from 52-week low
j6
Percent change from 52-week low
k1
Last trade (real-time) with timek2
Change percent (real-time)
k3
Last trade size
k4
Change from 52-week highk5
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 rangem2
Day's range (real-time)
m3
50-day moving average
m4
200-day moving averagem5
Change from 200-day moving average
m6
Percent change from 200-day moving average
m7
Change from 50-day moving averagem8
Percent change from 50-day moving average
n
Name
n4
Noteso
Open
p
Previous close
p1
Price paidp2
Change in percent
p5
Price/sales
p6
Price/bookq
Ex-dividend date
r
P/E ratio
r1
Dividend pay dater2
P/E ratio (real-time)
r5
PEG ratio
r6
Price/EPS estimate current yearr7
Price/EPS estimate next year
s
Symbol
s1
Shares owneds7
Short ratio
t1
Last trade time
t6
Trade linkst7
Ticker trend
t8
1 year target estimate
v
Volumev1
Holding's value
v7
Holding's value (real-time)
w
52-week rangew1
Day's value change
w4
Day's value change (real-time)
x
Stock exchangey
Dividend & yield