{"id":36890677,"url":"https://github.com/mccright/weather-in-terminal","last_synced_at":"2026-01-12T15:36:19.920Z","repository":{"id":213379050,"uuid":"733664087","full_name":"mccright/weather-in-terminal","owner":"mccright","description":"Display one-line of weather information in your terminal for any city+country supported on OpenWeather","archived":false,"fork":false,"pushed_at":"2026-01-10T13:05:46.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T03:49:34.593Z","etag":null,"topics":["terminal-app","terminal-based","weather","weather-app","weather-conditions","weather-information"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mccright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-19T21:00:33.000Z","updated_at":"2026-01-10T12:37:38.000Z","dependencies_parsed_at":"2024-06-05T13:05:58.035Z","dependency_job_id":"69a4d4c1-37d8-4f35-aa4f-d037ea2e9327","html_url":"https://github.com/mccright/weather-in-terminal","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.02564102564102566,"last_synced_commit":"e8515092d8bd77c3a726b264deeaf5319f90ad87"},"previous_names":["mccright/weather-in-terminal"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mccright/weather-in-terminal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccright%2Fweather-in-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccright%2Fweather-in-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccright%2Fweather-in-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccright%2Fweather-in-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mccright","download_url":"https://codeload.github.com/mccright/weather-in-terminal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccright%2Fweather-in-terminal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["terminal-app","terminal-based","weather","weather-app","weather-conditions","weather-information"],"created_at":"2026-01-12T15:36:19.816Z","updated_at":"2026-01-12T15:36:19.909Z","avatar_url":"https://github.com/mccright.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# weather\nDisplay one-line of weather information in your terminal for any city+country supported on [OpenWeather](https://openweathermap.org/).  \n\nIf this is something you are considering, look at the vastly superior [https://github.com/gourlaysama/girouette](https://github.com/gourlaysama/girouette)!  It is an exceptionally capable and flexible utility for displaying OpenWeather information in a terminal and may be a perfect for many.  \n\n## Why not girouette?  \nI have moved/added my Linux and Windows endpoints too many times in recent years.  Some of those moves involved investing more time than I will admit reconfiguring my new giroutte installation.  \n\nAfter giroutte installation and configuration, on Linux I add a bash alias that maps the command \"weather\" to giroutte.  On Windows I did an analogous \"*alias*\" using a command file (*and later Powershell*).  \nHere is an example for Linux from my .bash_aliases file:  \n\n```terminal\n# Get the current weather\n# Depends on a config file in ~/.config/girouette/config.yml\nif [ -x ~/bin/girouette ]; then\n        alias weather='/usr/bin/echo `~/bin/girouette`'\nfi\n```\n\nI have been using giroutte long enough to know what I want to see in my terminal, so it seemed rational to just code up a short script to fetch openweathermap.org data myself.  \n\n## This utility:  \nReturns a terse weather report using [data](https://openweathermap.org/current#data) from an [api.openweathermap.org service](https://openweathermap.org/current) on a single line in my standard terminal configuration.  I use it multiple times every day.  The report includes:  \n* date and time of weather measurements (in your local time zone if it can be determined by OpenWeatherMap)  \n* measured temperature, defaults to Fahrenheit (change via command line/alias or default in code for Celsius)  \n* \"feels like\" temperature, defaults to Fahrenheit (change via command line/alias or default in code for Celsius or Kelvin)  \n* wind direction  \n* wind speed, defaults to miles/hour (change via command line/alias or default in code for km/hour)  \n* humidity in percent  \n\nThis script requires an [OpenWeather API key](https://openweathermap.org/appid) (*free for 1 call per second*) -- put it in the configuration file *or* get it into your environment (ideally from your secret store, rather than a clear text file.  It is easy to [sign-up for an account](https://openweathermap.org/home/sign_up) and then [get the required key](https://home.openweathermap.org/api_keys).  \n\nYou can supply a city and nation on the command line.  City names having one or more spaces, must be surrounded by quotes (e.g. \"los angeles\").  The nation is specified using the 2-letter [ISO 3166 code](https://en.wikipedia.org/wiki/ISO_3166).  See the examples below.  \n\n## Lookup the abbreviation, country code, and/or Lat.Lon. for a city you want to monitor.  \nYou can use the [OpenWeatherMap geo-coding API](https://openweathermap.org/api/geocoding-api) to lookup the country code or lat/lon for a given city.\n\nIn the example below, we request the locations named \"pune\" and the API returned three: Pune, India; Pune, Indonesia; and Pune, Timor Leste.  In my case, I wanted Pune, India, so my city/nation would be ```python3 weather.py -c r pune -n in```.\n\n```terminal\ncurl https://api.openweathermap.org/geo/1.0/direct?q=pune\u0026limit=5\u0026appid=[put your API key here]\n[\n  {\n    \"name\": \"Pune\",\n    \"local_names\": {\n      \"mr\": \"पुणे शहर\",\n      \"ar\": \"مدينة بونه\",\n      \"ml\": \"പൂണെ\",\n      \"te\": \"పూణే\",\n      \"en\": \"Pune\",\n      \"zh\": \"浦那\",\n      \"hi\": \"पुणे\",\n      \"kn\": \"ಪುಣೆ\",\n      \"pa\": \"ਪੁਣੇ\",\n      \"he\": \"פונה\",\n      \"ur\": \"شہر پونے\",\n      \"ps\": \"پونی\",\n      \"ru\": \"Пуне\",\n      \"fa\": \"پونه\"\n    },\n    \"lat\": 18.521428,\n    \"lon\": 73.8544541,\n    \"country\": \"IN\",\n    \"state\": \"Maharashtra\"\n  },\n  {\n    \"name\": \"Pune\",\n    \"lat\": 1.7837578,\n    \"lon\": 127.8542945,\n    \"country\": \"ID\",\n    \"state\": \"North Maluku\"\n  },\n  {\n    \"name\": \"Pune\",\n    \"lat\": -9.36924,\n    \"lon\": 124.31618,\n    \"country\": \"TL\",\n    \"state\": \"Oecussi-Ambeno\"\n  }\n]\n```\n\n\n## Installation:\nI assume that you already have Python installed and use it regularly.  Clone this repository (```git clone https://github.com/mccright/weather-in-terminal.git```) and make any customizations to meet your needs.  Then locate ```weather.py``` and ```weather.ini``` in your local bin path (*or not, for more resistance to abuse*).  Then add a shell alias (*with command line options to meet your needs*) analogous to the example below:  \n\n```terminal\n# Get the current weather\n# This example depends on\n# A) your OpenWeatherMap API key is in the local environment (the default) *or*\n# B) your OpenWeatherMap API key is in a config file in ~/bin/weather.ini (without the '-f')\n#  (or someother location, which you will specify on the command line or as shown below \n#  in a bash alias, for example `-f path_to_config_file/weather.ini`)\nfunction weather() {\n  if [ -r ${HOME}/bin/weather.py ] \u0026\u0026 [ -r \"${HOME}/.config/weather-in-terminal/weather.ini\" ]; then\n        /usr/bin/python3 ${HOME}/bin/weather.py -f ${HOME}/.config/weather-in-terminal/weather.ini\n  fi\n}\n```\n\nIn a Windows-only environment you can also set up a Windows shortcut pointing to (*with paths that match your endpoint and with command line options that meet your needs*):  \n\n```terminal\nC:\\Windows\\System32\\cmd.exe /K \"C:\\PROGRA~1\\Python311\\python.exe  C:\\testing\\weather.py\"\n```\n\n## Examples:  \n\n*Without using the ```alias``` approach outlined above, to demonstrate command line options...*  \n\n```terminal\nmatt@hostname:/testing$ python3 weather.py\n2023-12-19 13:23, 42.51°F, feels like 34.74°F, wind S 16.11 m/h, broken clouds, humidity 40%\n\nmatt@hostname:/testing$ python3 weather.py -c denver\n2023-12-19 13:10, 62.85°F, feels like 59.83°F, wind SSW 2.71 m/h, clear sky, humidity 21%\n\nmatt@hostname:/testing$ python3 weather.py -c chicago -n us -f ~/secured/weather.ini\n2023-12-19 13:29, 31.6°F, feels like 22.51°F, wind SSW 11.5 m/h, scattered clouds, humidity 49%\n\nmatt@hostname:/testing$ python3 weather.py -c rome -n it\n2023-12-19 13:30, 49.57°F, feels like 48.79°F, wind SSE 3.44 m/h, clear sky, humidity 62%\n\nmatt@hostname:/testing/$ python3 weather.py -c pune -n in\n2023-12-20 11:35, 68.27°F, feels like 66.63°F, wind E 5.48 m/h, overcast clouds, humidity 39%\n\nmatt@hostname:/testing$ python3 weather.py -c edinburgh -n uk\n2023-12-19 16:58, 43.02°F, feels like 34.54°F, wind WSW 19.57 m/h, clear sky, humidity 82%\n\nmatt@hostname:/testing$ python3 weather.py -c santiago -n cl\n2023-12-19 17:01, 71.17°F, feels like 70.05°F, wind SW 14.97 m/h, smoke, humidity 44%\n\nmatt@hostname:/testing$ python3 weather.py -c nairobi -n ke\n2023-12-19 17:07, 63.72°F, feels like 63.64°F, wind NNE 6.91 m/h, broken clouds, humidity 82%\n\nmatt@hostname:/testing$ python3 weather.py -c \"los angeles\" -n us\n2023-12-19 17:13, 63.43°F, feels like 63.09°F, wind SE 9.22 m/h, overcast clouds, humidity 77%\n\nmatt@hostname:/testing$ python3 weather.py -h\nusage: weather [-h] [-d] [-l LANGUAGE] [-c CITY_NAME] [-n NATION_NAME] [-u UNITS_OF_MEASUREMENT] [-f CONFIG_FILE_NAME]\n\nweather: a terminal script to fetch current weather from openweathermap.org\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d, --debug           Use to send debug logging to console (unfinished)\n  -l LANGUAGE, --language LANGUAGE\n                        Either collect the language.\n                         Or just use the default language.\n  -c CITY_NAME, --city_name CITY_NAME\n                        Either collect the target city name.\n                         Or just use the default city name.\n  -n NATION_NAME, --nation_name NATION_NAME\n                        Either collect the target nation name.\n                         Or just use the default country name\n  -u UNITS_OF_MEASUREMENT, --units_of_measurement UNITS_OF_MEASUREMENT\n                        Changes temp and wind speed units. Default: \"imperial\"\n                         Options are: \"standard\" (Kelvin/km),\n                         \"metric\" (Celsius/km), and\n                         \"imperial\" (Fahrenheit/miles) units.\n  -f CONFIG_FILE_NAME, --config_file_name CONFIG_FILE_NAME\n                        Name of the configuration file.\nmatt@hostname:/testing$\n```\n\n## Other Python-Based CLI Weather Lookup Scripts  \ncurrent-conditions-openweather  \nhttps://github.com/jfcarr/current-conditions-openweather/  \nSimple text output of current weather conditions, retrieved from OpenWeather API.  \n\nPyWeather  \nhttps://gitlab.com/o355/PyWeather  \nThe fun way to check the weather in a terminal.  \n\nMesoPy (MesoWest API Wrapper): Current Weather Conditions  \nhttps://github.com/nick3499/mesowest_latest_ob  \n\n\n## Other Weather APIs to try  \n* Weather API https://github.com/weatherapicom/python  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccright%2Fweather-in-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmccright%2Fweather-in-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccright%2Fweather-in-terminal/lists"}