Biyori: Terminal Weather With Radar

biyori terminal tui weather

Biyori: Terminal Weather. TUI ascii weather application.

  • Added alert notification on current weather screen.
  • Added weather codes for more reliable conditions and reworked icons.
  • Added automatic username to paths in biyori and radar sh files. You shouldn’t need to edit these now.
    • You can start Biyori and stand-alone radar without the need to issue virtual environment activate with the following commands ~/Biyori/biyori.sh and ~/Biyori/radar.sh respectively.
  • Added future temps, humidity, and rain graphs.
  • Added radar. Since I could not reliably present it in Textual, I elected to open in another terminal tab or window. You can run the radar on it’s own also.
  • Added sunrise, sunset, and moon phases.
  • Added terminal bell ring on alerts. Some terminals do not support this and others allow it to be turn on or off in their settings. Tabby has the bell disabled by default and also has a setting for visual alert rather than audible.
  • Removed light and dark mode swap. You can un-comment that code if you prefer light, but a lot of the text and ascii art might need tweaked in code if you do so.

If you only want a fully working stand-alone version of animated ASCII radar, see this. An updated version of the code is in the below zip as well.

Instructions to configure and get everything working included in zip or grab below.

Download Source

Contains biyori.py, biyori.sh, get_radar.py, radar.sh, and requirements.txt

Checksum (SHA256): 325f9f6cc975a4f6e3dc496dbdcd4dc736c0abd3c43ad82a75d060fda6a21127

Instructions (pdf)

Disclosure

  • Tested in Wave, Gnome-Terminal, and Tabby terminals. I find Tabby to be flawless as was gnome-terminal, Wave may not run the radar correctly and due to sizing constraints the display and radar can be easily borked.
  • This was written for Linux. This is not to say it won’t work on Windows, but you will need to make path changes in the code and create cmd\bat files as replacements for Bash scripts.
  • Buggy? Maybe. I whipped this up fairly quickly while learning Textual along the way. It is a work in progress.
  • Weather accurate? I use Open Medeo Weather and National Weather Service APIs. I grab the sun and moon from the US Navy. They are free. They seem to jive. Best part? No accounts needed.
  • I created the ascii weather icons, they are free and you can do whatever you want with them with no restriction.
  • The code is also free. Do what you wish with no restrictions. It is buggy, it could be better, I don’t care. It does what I want. Use it to learn or change it to your needs.
  • Configuration is not accessible within the app so you need to edit the config file outside of Biyori. See Configuration below. It’s not that bad 🙂
  • I apologize, this only supports United States weather.
  • String formatting is a mess!
  • Textual themes are not persistent.
  • Not tested on Windows or Mac. It might work.
  • I have not tested the radar in Wave or via Biyori running as a Wave template.
  • Needs code cleanup. We will see how much time I have.

Shout out

Textual, Rich Gradient, and Rich are so cool and very well done. I would like to thank the developers for such awesome Python libraries, all of them!

Configuration

When you first run the program it will, or should, create a config file in ~/.config under biyori. You need to edit this file manually to add your latitude, longitude, and state or you will be looking at Ohio. No one wants to look at Ohio. This is covered in the readme.

I set the refresh rate to every hour for myself. Don’t beat the services up too much, especially Open Meteo (has a paid version) or you may find yourself blocked. I would think 15 minutes or greater should be alright.

Here is an updated video showing it running…

Biyori Weather Running

Screenshots of each tab and radar.

Biyori as a Wave terminal widget

Adding Biyori as a widget in Wave terminal: Bash only.

Add the following to ~/snap/waveterm/114/.config/waveterm/widgets.json or where ever it resides on your system. Alternatively, right click existing widget icons in Wave for quick edit of the widgets.json file.

Be sure to set the correct path in cmd for your environment.

{
    "biyori" : {
	"icon": "cloud",
	"color": "#00FFFF",
	"label": "Biyori",
	"magnified": false,
	"blockdef": {
	        "meta": {
		        "view": "term",
		        "controller": "cmd",
		        "cmd":"./Biyori/biyori.sh"
            }
	     }
     }
}
#!/bin/bash

# Shell script for Wave... Be sure to make this executable.
set USER = whoami
cd /home/${USER}/Biyori
. bin/activate; bin/python3 biyori.py

Screenshots (Wave)

Leave a Reply