Skip to main content

Look up and plot current stock prices from your terminal

Project description

StockStack-CLI

Look up and plot current stock prices from your terminal.

This is a Python script for monitoring the current stock prices using the Yahoo Finance API to retrieve the latest stock prices and display them in the terminal.

INSTALLATION

  1. Make sure to have yfinance and other needed dependecies installed
$ pip install -r stockstack/requirements.txt
  1. Clone this repository to your local machine
$ git clone https://github.com/carlobortolan/StockStack.git ~/stockstack
  1. Add <YOUR_ALIAS> as an alias to your .bashrc, .zshrc, etc.
$ echo 'alias <YOUR_ALIAS>="python3 ~/stockstack/caller.py"'>>~/.bashrc

OPTIONAL: If you want to have StockStack launch whenever you open a new terminal add:

$ echo '<YOUR_ALIAS>'>>~/.bashrc
  1. Update your .bashrc, .zshrc, etc.
$ source ~/.bashrc

USAGE

Retrieve current stock prices.

$ <YOUR_ALIAS>  [] [-s STOCK_SYMBOL [STOCK_SYMBOL ...]]
                [-d STOCK_SYMBOL [STOCK_SYMBOL ...]]
                [-u STOCK_SYMBOL [STOCK_SYMBOL ...]] 
                [-p] [--details] [-v] [-h]
options:
  -h, --help            show this help message and exit
  -s STOCK_SYMBOL [STOCK_SYMBOL ...], --stocks STOCK_SYMBOL [STOCK_SYMBOL ...]
                        List of stocks to monitor.
  -d STOCK_SYMBOL [STOCK_SYMBOL ...], --default_stocks STOCK_SYMBOL [STOCK_SYMBOL ...]
                        Set the default stocks to monitor.
  -u STOCK_SYMBOL [STOCK_SYMBOL ...], --update_default_stocks STOCK_SYMBOL [STOCK_SYMBOL ...]
                        Update the default stocks.
  -p [PLOT], --plot [PLOT]
                        Plot the current or default stocks.
  --details [DETAILS]   Display additional details about a stock.
  -v, --version         show program's version number and exit

EXAMPLES

NOTE: Replace with your alias if necessary.

To retrieve the current stock prices for a list of stocks, run the script with the following command:

python caller.py -s AAPL MSFT TSLA

This will display the current prices for Apple, Microsoft and Tesla stocks.

To set the default stocks to monitor, use the -d or --default_stocks option:

python caller.py -d AAPL MSFT

This will set the default stocks to Apple and Microsoft.

To update the default stocks, use the -u or --update_default_stocks option:

python caller.py -u AAPL GOOG

This will add Apple and Google stocks to the default list (if not already added).

To view the current price of your default list run the script without any options:

python caller.py

To view details of your default list or other stocks use the --details option:

python caller.py --details

To plot the graph of your default list or other stocks use the -p or --plot option:

python caller.py -p

CONTRIBUTING

Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request.

LICENSE

This project is licensed under the GPL-3.0 license. See the LICENSE file for details.


© Carlo Bortolan

Carlo Bortolan  ·  GitHub carlobortolan  ·  contact via carlobortolan@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StockStack-0.1.tar.gz (14.8 kB view details)

Uploaded Source

File details

Details for the file StockStack-0.1.tar.gz.

File metadata

  • Download URL: StockStack-0.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for StockStack-0.1.tar.gz
Algorithm Hash digest
SHA256 9816bd92c9f9b80fcf39677a4db19be9320a69c8c8efc92b05654c7c91c3cb70
MD5 eccb911f64c45e08936a0fecf24ed53d
BLAKE2b-256 8b30a334bede2b013b0c968d28557cd807303fd2a73d66827def45957031cd57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page