Skip to content

jdamcd/inky-stocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inky Stocks

A stock ticker for the Raspberry Pi Zero & Pimoroni Inky pHAT, fetching daily stock performance from the Yahoo Finance API:

  • Supports any symbol on Yahoo Finance
  • Displays the most recent day if the market is closed
  • Works for 24/7 symbols like BTC-USD
  • Plots the end of the previous day if the market opened <2 hours ago

Output on the Inky pHAT

Optionally, if you install the Pimoroni LED SHIM, it will light up green or red depending on whether the symbol is up or down.

Setup

You'll need a Raspberry Pi Zero 2 (or WH) with the Pimoroni Inky pHAT installed. This project only supports the current 250x122 resolution version. Remember to install the Inky library on your Raspberry Pi first.

  1. Activate your Python virtual environment, e.g. the default from the Inky pHAT install guide:

    source ~/.virtualenvs/pimoroni/bin/activate
  2. Install the project dependencies:

    pip install -r requirements.txt

Example usage

Index Stock Crypto
python stocks.py --symbol ^FTSE python stocks.py --symbol AAPL python stocks.py --symbol BTC-USD
FTSE AAPL BTC

If you don't provide a --symbol parameter the script defaults to ^GSPC (S&P 500). Add the --three-color flag if you have the black/white/red variant of the display and you want the red highlights.

Auto refresh

  1. Create a bash script in the project directory and make it executable (touch run.sh && chmod +x run.sh):

    #!/bin/bash
    source ~/.virtualenvs/pimoroni/bin/activate
    python ~/inky-stocks/stocks.py --symbol ^FTSE --three-color
  2. Add a cron job to run the script every 15 minutes:

    crontab -e
    */15 * * * * ~/inky-stocks/run.sh
    

Disclaimer

Obviously this is just for fun, there are no guarantees about the accuracy of the data, and you shouldn't use this to make any financial decisions. :)

About

Stock ticker for Pi Zero & Inky pHAT

Topics

Resources

License

Stars

Watchers

Forks

Languages