Muni Display is a Python-based application designed to fetch real-time San Francisco Muni transit data and display it on an e-ink screen. This project is ideal for Raspberry Pi setups with Waveshare displays, offering a low-power, always-on transit dashboard.
- Real-time Muni transit data
- E-ink display rendering
- HTML-to-image support
- Lightweight and efficient
python3 main.pyEnsure your e-ink screen is connected and supported by the Waveshare driver.
To add or remove stops from the display, you need to update both main.py and hello.html.
Use the get_formatted_arrival_times function to populate a new stop:
STOP_ID_5_MARKET = '12345' # Replace with the actual stop ID
formattedTimes = {
"times_L_em": get_formatted_arrival_times(get_muni_stop_data(STOP_ID_L_OWL_EASTBOUND)),
"times_28_fw": get_formatted_arrival_times(get_muni_stop_data(STOP_ID_28_NORTHBOUND)),
"times_5_mkt": get_formatted_arrival_times(get_muni_stop_data(STOP_ID_5_MARKET)),
"current_time": current_time
}Add a new <tr> to the table:
<tr>
<td class="no-right-border">
<div class="cell-content">
<div class="circle"><span>5</span></div>
<div class="text-block">
<span class="destination">Market Street</span>
<span class="times">{{ times_5_mkt }}</span>
</div>
</div>
</td>
</tr>Make sure the {{ times_5_mkt }} key matches the one in formattedTimes.
- Delete the corresponding key from
formattedTimesinmain.py. - Remove the associated row (
<tr>) fromhello.html.
main.py– App entry pointmuni.py– Fetches and parses transit dataeinkUtils.py– Handles e-ink display renderingutils.py– HTML/image utilities
requests
Pillow
RPi.GPIO
spidev
python-periphery
html2image
jinja2
weasyprint
pdf2image
pytz
waveshare-epdMIT License
🧠 Note: This project was created with approximately 99% help from AI (ChatGPT).