{"id":13487325,"url":"https://github.com/DeepSpace2/powerline-owmweather","last_synced_at":"2025-03-27T21:32:25.205Z","repository":{"id":62577977,"uuid":"308981185","full_name":"DeepSpace2/powerline-owmweather","owner":"DeepSpace2","description":"A Powerline segment for fetching and showing the weather in the current location","archived":false,"fork":false,"pushed_at":"2020-11-04T17:41:40.000Z","size":54,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-25T07:44:13.879Z","etag":null,"topics":["cli","poweline","segment","shell","terminal","weather"],"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/DeepSpace2.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}},"created_at":"2020-10-31T22:15:25.000Z","updated_at":"2023-11-23T09:46:18.000Z","dependencies_parsed_at":"2022-11-03T19:38:04.319Z","dependency_job_id":null,"html_url":"https://github.com/DeepSpace2/powerline-owmweather","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2Fpowerline-owmweather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2Fpowerline-owmweather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2Fpowerline-owmweather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2Fpowerline-owmweather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepSpace2","download_url":"https://codeload.github.com/DeepSpace2/powerline-owmweather/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245927440,"owners_count":20695233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","poweline","segment","shell","terminal","weather"],"created_at":"2024-07-31T18:00:57.738Z","updated_at":"2025-03-27T21:32:25.185Z","avatar_url":"https://github.com/DeepSpace2.png","language":"Python","funding_links":[],"categories":["Segments"],"sub_categories":[],"readme":"[![PyPI](https://img.shields.io/pypi/v/powerline-owmweather?color=blue\u0026logo=python\u0026logoColor=green\u0026style=plastic)](https://pypi.org/project/powerline-owmweather/)\n[![Downloads](http://pepy.tech/badge/powerline-owmweather)](http://pepy.tech/count/powerline-owmweather)\n\n# powerline-owmweather 🌦\n\n![Example 1](readme-images/screenshot1.png?raw=true)\n\nA light-hearted [Powerline](https://github.com/powerline/powerline) segment for fetching and showing the weather in the current location (either by IP geolocation or by setting a location, see [Configuration](#configuration) below).\n\n\n- [Motivation](#motivation)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Activation](#activiation)\n- [Configuration and Customization](#configuration-and-customization)\n- [Changelog](#changelog)\n- [TODO](#todo)\n\n## Motivation\n\nThe built-in weather segment is using Yahoo Weather API which is no longer available so I decided to create an almost drop-in replacement using [OpenWeather](https://openweathermap.org/).\n\n## Requirements\n\n - [Powerline](https://github.com/powerline/powerline)\n - A (free) [OpenWeather](https://openweathermap.org/) account and API key with the \"Current Weather Data\" plan enabled.\n \n## Installation\n \n```\npip install powerline-owmweather\n```\n\n## Activation\n \nThe very minimum required to activate the segment is to add the following to your theme JSON:\n \n```\n{\n   \"function\": \"powerline_owmweather.weather\",\n   \"args\": {\n       \"openweathermap_api_key\": API_KEY\n   }\n}\n```\n\nAlternatively, the API key can also be provided by setting it as an environment variable,\nsee [Configuration and Customization](#configuration-and-customization) for details. \n\nand the following to your colorscheme JSON (the colors can be customized):\n \n```\n\"groups\": {\n      ...,\n      \"owmweather\": {\n          \"fg\": \"gray9\",\n          \"bg\": \"gray2\",\n          \"attrs\": []\n    }\n}\n```\n \n## Configuration and Customization\n \nThe following optional `args` are available:\n \n| Argument                 | Type    | Description                                                                                                                                                          | Default                                                      |\n|--------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n| `openweathermap_api_key` | string  | If not provided in the theme JSON, the segment will try to use the `POWERLINE_OPENWEATHERMAP_API_KEY` environment variable                                           | `POWERLINE_OPENWEATHERMAP_API_KEY` \u003cbr/\u003eenvironment variable |\n| `condition_as_icon`      | boolean | If `true`, condition will be displayed as an icon (if one of known conditions).\u003cbr\u003eIf `false` condition will be displayed as a string                                | `true`                                                       |\n| `humidity_format`        | string  | A Python format string that accepts `humidity` as an argument                                                                                                        | `\"{humidity:.0f}\"`                                           |\n| `location_query`         | string  | Location in format CITY, 2-LETTERS-COUNTRY-CODE                                                                                                                      | Retrived using IP geolocation                                | \n| `post_condition`         | string  | String to append after `condition`                                                                                                                                   | \"\"                                                           |\n| `post_humidity`          | string  | String to append after `humidity`                                                                                                                                    | \"\"                                                           |\n| `post_location`          | string  | String to append after `location`                                                                                                                                    | \"\"                                                           |\n| `post_temp`              | string  | String to append after `temp`                                                                                                                                        | \"\"                                                           |\n| `pre_condition`          | string  | String to prepend before `condition`                                                                                                                                 | \" \"                                                          |\n| `pre_humidity`           | string  | String to prepend before `humidity`                                                                                                                                  | \" \"                                                          |\n| `pre_location`           | string  | String to prepend before `location`                                                                                                                                  | \" \"                                                          |\n| `pre_temp`               | string  | String to prepend before `temp`                                                                                                                                      | \" \"                                                          |\n| `show `                  | string  | Comma-separated string specifies what data to show.\u003cbr\u003eCan include `\"condition\"`, `\"humidity\"`, `\"location\"`, `\"temp\"`.\u003cbr\u003eSee [Highlight Groups](#highlight-groups) | `\"temp\"`                                                     |\n| `temp_format`            | string  | A Python format string that accepts `temp` as an argument                                                                                                            | `\"{temp:.0f}\"`                                               |\n| `ttl_in_minutes`         | integer | Time in minutes for which location and weather are cached.\u003cbr\u003e**Warning: The lower the value the slower your terminal will be**                                      | 60                                                           |\n| `units`                  | string  | Temperature units.\u003cbr\u003eShould be one of `\"C\"`, `\"F\"`, `\"K\"`                                                                                                           | `\"C\"`                                                        |\n\n### Highlight Groups\n\nEvery data in `\"show\"` is displayed in its own segment with its own highlight group, meaning it can be styled independently in your colorscheme JSON. Each highlight group is composed of `owmweather_{data_name}`, for example:\n\n```\n\"owmweather_condition\": {\n    \"fg\": \"gray6\",\n    \"bg\": \"gray3\",\n    \"attrs\": []\n},\n\"owmweather_temp\": {\n    \"fg\": \"gray9\",\n    \"bg\": \"gray2\",\n    \"attrs\": []\n}\n```\n\n`\"pre_{data_name}\"` and `\"post_{data_name}\"` can also be customized using `\"owmweather_pre_{data_name}\"` and `\"owmweather_post_{data_name}\"` highlight groups.\n\nIf a specific highlight group is not defined then the style of `\"owmweather\"` group will be used.\n\n## Changelog\n\n### 0.5 - Dec. 27 2024\n* Allowing to set openweathermap API key as an environment variable\n\n### 0.4 - Nov. 3 2020\n* `'%'` is no longer in the default `humidity_format`\n* Added `pre_data` and `post_data` arguments and highlight groups\n* Added ability to show location\n\n### 0.3 - Nov. 1 2020\n* Added ability to display humidity\n\n### 0.2 - Nov. 1 2020\n* Added ability to display temperature, condition\n* Added ability to display condition as either icons or strings\n\n### 0.1.1 - Oct. 31 2020\n* Fixed a bug that prevented setting a custom `ttl_in_minutes`\n* Added debug logs\n\n### 0.1.0 - Oct. 31 2020\nInitial release\n\n## TODO\n\n - [x] Support icons\n - [x] Support weather description (\"cloudy\", \"windy\", etc)\n - [ ] Support configurable information to display:\n   - [x] Temperature\n   - [x] Condition\n   - [ ] Wind speed/direction\n   - [x] Humidity\n   - [ ] Pressure\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDeepSpace2%2Fpowerline-owmweather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDeepSpace2%2Fpowerline-owmweather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDeepSpace2%2Fpowerline-owmweather/lists"}