https://github.com/jdamcd/inky-stocks
Stock ticker for Pi Zero & Inky pHAT
https://github.com/jdamcd/inky-stocks
e-ink inkyphat pimoroni raspberry-pi-zero yahoo-finance
Last synced: 4 months ago
JSON representation
Stock ticker for Pi Zero & Inky pHAT
- Host: GitHub
- URL: https://github.com/jdamcd/inky-stocks
- Owner: jdamcd
- License: apache-2.0
- Created: 2025-02-23T21:49:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-14T19:43:39.000Z (5 months ago)
- Last Synced: 2026-01-14T23:37:31.621Z (5 months ago)
- Topics: e-ink, inkyphat, pimoroni, raspberry-pi-zero, yahoo-finance
- Language: Python
- Homepage:
- Size: 1.63 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Inky Stocks
A stock ticker for the Raspberry Pi Zero & Pimoroni Inky displays, 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
- Supports both Inky pHAT (250x122) and Inky wHAT (400x300) displays

## Setup
You'll need a Raspberry Pi Zero 2 (or WH) with either:
- [Pimoroni Inky pHAT](https://shop.pimoroni.com/products/inky-phat) (250x122 version)
- [Pimoroni Inky wHAT](https://shop.pimoroni.com/products/inky-what)
[Install the Inky library](https://learn.pimoroni.com/article/getting-started-with-inky-phat) on your Raspberry Pi before running this script.
1. Activate your Python virtual environment, e.g. the default from the Inky pHAT install guide:
```bash
source ~/.virtualenvs/pimoroni/bin/activate
```
2. Install the project dependencies:
```bash
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` |
|  |  |  |
### Multiple symbols (wHAT only)
```bash
# Show 3 major indices
python stocks.py --symbols ^GSPC ^FTSE ^DJI
```
### Options
- Add the `--three-color` flag if you have a black/white/red variant of the display and you want the red highlights.
- Install the Pimoroni LED SHIM alongside the pHAT and it'll will light up green or red depending on whether the stock is up or down.
- You can test without hardware by running the display variant script directly (`stocks_phat.py` or `stocks_what.py`) with the same arguments. The screen output will be saved as a PNG.
### Auto refresh
1. Create a bash script in the project directory and make it executable (`touch run.sh && chmod +x run.sh`):
```bash
#!/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:
```bash
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. :)