# How to Build a Command-Line Weather App with Python

DevFeed: [How to Build a Command-Line Weather App with Python](<https://devfeed.tech/articles/how-to-build-a-command-line-weather-app-with-python-105931.md>)

Original publisher: [Read original article](<https://www.freecodecamp.org/news/how-to-build-a-command-line-weather-app-with-python/>)

Author: Sameer Qaiser

Published: 2026-10-28T21:16:04Z

Content type: tutorial

Language: en

Sources: [Free Code Camp](<https://devfeed.tech/sources/freecodecamp-programming-tutorials-python-javascript-git-more.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Terminal](<https://devfeed.tech/topics/terminal.md>), [console](<https://devfeed.tech/topics/console.md>), [IO](<https://devfeed.tech/topics/io.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [app](<https://devfeed.tech/tags/app.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [beginner-developers](<https://devfeed.tech/tags/beginner-developers.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [http](<https://devfeed.tech/tags/http.md>), [json](<https://devfeed.tech/tags/json.md>), [python](<https://devfeed.tech/tags/python.md>), [weather](<https://devfeed.tech/tags/weather.md>), [webdev](<https://devfeed.tech/tags/webdev.md>)

## AI overview

The tutorial builds a Python terminal app that accepts a city name, uses Open-Meteo's geocoding API to get the first matching coordinates, then requests current temperature at 2 meters and wind speed at 10 meters. It uses `requests` with a five-second timeout and HTTP error checks, parses JSON, and prints the results in Celsius and km/h. `sys.argv` handles city names with spaces; the script reports missing input, unknown cities, connection failures, and selected data-reading errors. Because it takes only the first geocoding match, ambiguous city names may resolve to the wrong place. Suggested extensions include humidity, a forecast, and choosing among multiple city matches.

## Source excerpt

After doing a few basic Python projects, I got a bit bored of programs that just take input and print something back. I wanted to make something that actually gets data from the internet. So, I built