Skip to content

ViennaMike/Multi-Function-PyPortal-Program

Repository files navigation

Multi-Function-PyPortal-Program

A PyPortal application example that cycles through five functions: displaying current day/date/time, current weather, a random piece of advice, the value of the S&P 500, and local pollen levels.

There are a lot of examples of single-function applications available, such as weather, air quality, event count-down clock, and even how many astronauts are currently in space, along with their names. What I wanted to do was to have the device cycle through multiple applications. I ended up coding it to provide the day, date, and time (inspired by how cruise ships change out a piece of carpet every day in the elevators to tell you what day of the week it is), the current local weather, a random piece of advice from the Advice Slip API, the current value and change from the previous day for the S&P 500 (since making this, the market data provider stopped providing index data in their free tier, so now use the SPY index-tracking ETF as a close surrogate), and local tree, weed, and grass pollen levels.

There's a main file (code.py) and then a separate module for parsing and formatting the data for each function. You'll need to edit the "settings.toml" file to provide your WIFI login information as well as sign up with the API providers and put your personal keys in that file: an OpenWeather token for the weather display (https://openweathermap.org/api) and a Google Maps Platform API key for the Pollen API (https://developers.google.com/maps/documentation/pollen). Additional information is available on my blog at https://www.mcgurrin.info/robots/620/

Latest update: May 2026 Reddit stopped supporting their free API access, so while the original program had the Reddit Shower Thoughts, this newer version uses a different source to provide random advice. the pollen level source was also updated and the code modified to reflect the new source's API. Finally, the original version was written for Circuit Python as it stood 7 years ago. There have been many revisions since then, including breaking revisions. With the help of Claude Code, this version now uses the latest version of Circuit Python.

About

A PyPortal application example that cycles through four functions: displaying current day/date/time, current weather, latest "shower thought" from the subreddit, and the value of the S&P 500

Resources

License

Stars

12 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages