Sonnenhut: a Script to Run before a Photo Walk

Before you head for a photo walk, it makes sense to check the weather and ensure that you won’t miss the golden hour. And Sonnenhut can help you with that. This simple Python script fetches and displays current weather conditions and golden hour info for a specified city. The script is available on GitHub under the GPLv3 license.

Besides the current weather summary, temperature, wind speed, and humidity, Sonnenhut also displays a precipitation warning (an umbrella icon) if there is a probability of rain or snow in the next three hours.

In addition to that, the Sonnenhut shows the content of the accompanying sonnenhut.txt file (you can change the name of the file and its location, if needed). You can use the file as a scratchpad for photography-related tasks and notes.


Sonnenhut uses the Astral Python module to obtain geographical coordinates of the specified city and calculate golden hour times. The pyowm module is used to fetch weather data, and it requires an API key. If you plan to use the script on a regular basis, please obtain your own key and use it instead of the default one in the script (replace the default value of the owm_api_key variable with your API key).

While the script works as intended, it’s still very much a work in progress. Feel free to fork the project and hack it to your heart’s content.

Tech writer covering Linux and open source software

Posted in Open Source, Photography, Software

Recipes for automated and streamlined photographic workflow on Linux

Use digiKam? Get this book!

Practical advice for nighttime photography

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: