Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertdavidwest/automated_stock_data_downloads
https://github.com/robertdavidwest/automated_stock_data_downloads
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/robertdavidwest/automated_stock_data_downloads
- Owner: robertdavidwest
- Created: 2013-12-13T01:08:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-18T00:02:17.000Z (over 10 years ago)
- Last Synced: 2024-04-19T16:13:54.379Z (7 months ago)
- Language: Python
- Size: 12.2 MB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
automated_stock_data_downloads
=============================##Installation
To install the `automated_stock_data_downloads` module onto your computer, go into
your desired folder of choice (say `Downloads`), and:1. Clone the repository
$ cd ~/Downloads
$ git clone https://github.com/robertdavidwest/automated_stock_data_downloads2. `cd` into the `automated_stock_data_downloads` directory
$ cd automated_stock_data_downloads
3. Install the package
$python setup.py install
4. Check your install. From anywhere on your machine, be able to open
`iPython` and import the library, for example:$ cd ~/
$ ipythonIPython 1.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import automated_stock_data_downloads##Documentation
The module 'get_stock_data' contains three functions: `adj_close()`, `sp500_tickers()` and
`russell3000_tickers()`.* `adjclose()`
def adj_close(interface_filename='get_stocks_for_tsr.xlsx', assumptions_first_row=4, ticker_first_row=8, assumptions_columns='B:C', ticker_columns='C'):
Given a Vaulation Date, Lookback Period and a list of tickers, this function will output a matrix of adjusted daily close stock
price data for each ticker provided, as well as the annualised volatility of the log returns of each ticker.All user inputs are entered via the interface file
default interface_filename: get_stock_data.xlsx
sheet name: Assumptions
| A | B | C |
--------------------------------------------------------------------------
1 | | | |
2 | | | |
3 | | | |
4 | | Valuation Date | MM/DD/YYYY |
5 | | Lookback Period (years) | 3 |
6 | | | |
7 | | | Tickers |
----------------
8 | | 1 | A |
9 | | 2 | AA |
10 | | 3 | AAPL |
: : :
:ARGS:
interface_filename: :meth:`str` The name of the excel interface file. The default name is
assumptions_first_row :meth: `int` The first row in the excel interface of input data. Do not change from the default
value unless the interface file has been modified
ticker_first_row :meth: `int` The first row in the excel interface of ticker data. Do not change from the default
value unless the interface file has been modified
assumptions_columns :meth:`str` A string showing the columns within the excel interface file holding the general
assumptions. Do not change from the default value unless the interface file has been modified
ticker_columns :meth:`str` A string showing the column within the excel interface file holding the tickers. Do not
change from the default value unless the interface file has been modified
:RETURNS:
The function will add 3 new sheets to the existing interface file1. Adj Close data: Adjusted close daily stock price data over the
specified period for all tickers
2. Volatility: The volatility of every ticker
3. No Data: A list of tickers that do not have any stock price
history over specified period.. warning:: Requires Internet Connectivity
Because the function calls the `Yahoo! API ` internet connectivity is required for the function to work
* `sp500_tickers()`
def sp500_tickers():
Obtain all current S&P contituent tickers from wikipedia.
The results will be output into a csv file
* `russell3000_tickers()`
def russell3000_tickers():
Obtain all current Russell 3000 contituent tickers from www.marketvolume.com.
The results will be output into a csv file