Skip to content

Python program to obtain stock prices given a list of tickers.

Notifications You must be signed in to change notification settings

highdeserthacker/stock-price-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

stock-price-reader

Python program to obtain stock/fund prices given a list of tickers. Generates a csv output file that can be imported e.g. into Excel. I use this to update a personal financials spreadsheet with the latest pricing. Utilizes the api provided by Alpha Advantage.

Built With

Python

Setup

Obtain a free api key from Alpha Advantage.

Usage

python -u stockprices.py  --apikey myapikey --input dir/input-file.csv --output dir/output-file.csv
-u: (optional) run with output unbuffered, so that debug output shows up real-time.
--input: input file. Text file containing the list of ticker symbols. Comma delimited format, 1 row per ticker.
--output: output csv file with results.
--debug 1: (optional) Debug mode is verbose and does not generate the output file.

Example: python -u /programs/python/stockprices.py  --apikey ABCDEFGHIJKLMNOP  --input tickers.csv --output ~/stockprices.csv

Example Input File

Ticker
IWV
MSFT
VTSAX

Example Output File

Ticker,Price
IWV,220.1600
MSFT,259.5800
VTSAX,91.7700

About

Python program to obtain stock prices given a list of tickers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages