A CLI tool to get close of day price and annual dividends
Project description
A CLI tool to get a close of day price and annual dividends for a set of tickers. Uses the tiingo python API.
Free software: MIT license
Features
Uses the tiingo python API to obtain most recent closing prices for a number of tickers. The tickers being specified in a text file, one ticker per line.
Last years dividends are also obtained and calculated for each ticker.
Output is either written to stdout or to a specified file. Output is written in CSV format with Ticker,Price,Dividend on each line of the file.
Installation
pip install tiingo_prices
Usage
Set the environment variable TIINGO_API_KEY to the API key associated with your tiingo account.
export TIINGO_API_KEY='YourTiingoAPIKey'
For these close of day prices and divdends the API key provided with the free “starter” account will work.
$ tiingo_prices -h
usage: tiingo_prices [-h] [--output_file OUTPUT_FILE] [--nyse_pref][--version] ticker_file
Returns the most recent closing prices and last years dividends for stocks
positional arguments:
ticker_file Ticker file name: One ticker per line
optional arguments:
-h, --help Show this help message and exit.
--output_file OUTPUT_FILE
Output file name: Default writes to stdout.
--nyse_pref Attempt to recognize NYSE Preferred ticker symbols
and convert to tiingo friendly format. Warning may
produce incorrect results for non NYSE stocks with PR
in their ticker name.
--version Show program's version number and exit.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tiingo_prices-0.3.1.tar.gz
.
File metadata
- Download URL: tiingo_prices-0.3.1.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2404106c6ad93ced118ab869e3b256f11acde7b33ef9e206f4781328d8cad8de |
|
MD5 | 649ff8f2d5eb1577385359d9b54f5afd |
|
BLAKE2b-256 | f42ec8a0c094bc91c690c63dcc1b82642d501e7c4e33eae6161263990a342743 |