robotframework-openweathermap
robotframework-openweathermap is a Robot Framework keyword collection for the OpenWeatherMap API.
Installation
The easiest way is to install this package is from pypi:
pip install robotframework-openweathermap
Robot Framework Library Examples
Prerequisites:
The accompanying Robot Framework test file relies on two requirements:
- get an OpenWeatherMap API key (it's free)
- create an environment variable
OWM_API_KEYand assign the OpenWeatherMap API key to that variable - Execute test with
robot keyword_checks.robot
Library usage and supported keywords
Default settings
The following rules apply:
- The default value for each parameter is
None - Each parameter supports
GetterandSetterkeywords, e.g,Set OpenWeatherMap Latitude - Each OpenWeatherMap Keyword also permits the usage of these parameters. Example:
Get Current Weather latitude=....
- A keyword's parameter value has priority over the
Settervalue. This means that if you useSet OpenWeathermap Latitude 10andGet Current Weather latitude=20, the value from the OWK Keyword will supersede theSetterkeyword and a value of20is going to be used.
Options for setting the parameter values
You can either specify all parameters during the initial setup of the library or alternatively via separate keywords
Option 1 - set as position parameters
*** Settings ***
Library OpenWeatherMapLibrary 51.82798 9.4455 ...
*** Test Cases ***
My first test case
Option 2 - set as named parameters
*** Settings ***
Library OpenWeatherMapLibrary latitude=51.82798 longitude=9.4455 ...
*** Test Cases ***
My first test case
Option 3 - Use Robot Keywords
Set OpenWeatherMap Latitude latitude=51.82798
Generic Getter / Setter Robot Keywords supported by this library
You can use these optional Getter/Setter methods for setting your fixed default values. If you specify the same parameter as part of the actual OpenWeatherMap keyword, the value specified with that API call supersedes these generic Getter/Setter values.
| Keyword | Description | Arguments | Valid Values |
|---|---|---|---|
Get/Set OpenWeatherMap Latitude |
Gets / Sets the latitude value | latitude |
float value |
Get/Set OpenWeatherMap Longitude |
Gets / Sets the longitude value | longitude |
float value |
Get/Set OpenWeatherMap API Key |
Gets / Sets the OWM API Key | apikey |
string |
Get/Set OpenWeatherMap Number Of Results |
Gets / Sets the max number of results | number |
integer > 0 |
Get/Set OpenWeatherMap Language |
Gets / Sets the desired output language | language |
see OpenWeatherMap API for valid values |
Get/Set OpenWeatherMap Excludes |
Gets / Sets the exclude(s) value. Separarate multiple values with a comma See API documentation for details |
exclude |
currentminutelyhourlydailyalerts |
Get/Set OpenWeatherMap Output Format |
Gets / Sets the output format (e.g. json) |
output_format |
jsonxmlhtml |
Get/Set OpenWeatherMap Unit Format |
Gets / Sets the unit format See API Documentation for details Format availability depends on API call |
unit_format |
standardmetricimperial |
Get/Set OpenWeatherMap Datetime Start |
Gets / Sets the start datetime for date ranges | dt_start |
Unix timestamp |
Get/Set OpenWeatherMap Datetime End |
Gets / Sets the end datetime for date ranges | dt_end |
Unix timestamp |
Get/Set OpenWeatherMap Datetime |
Gets / Sets a single point in time | dt |
Unix Timestamp |
OpenWeatherMap Keywords
Please note that a majority of these keywords requires a paid OpenWeatherMap subscription. You can still try to run the keywords but most of them will fail with a http 4xx error unless you have a valid paid subscription.
Each of the following keywords has a set of mandatory parameters. which means that if you used the setter methods to assign values for latitude and longitude, for example, you can omit those values for the following keywords.
| Keyword | Description | Mandatory parameters |
Optional parameters |
Comments |
|---|---|---|---|---|
| Get Current Weather | Access current weather data for any location on Earth including over 200,000 cities |
latitudelongitudeapikey |
output_formatunit_formatlanguage |
|
| Get Hourly Forecast 4 Days | Hourly forecast for 4 days (96 timestamps) | latitudelongitudeapikey |
output_formatnumberlanguage |
no output_formatsupport for HTML |
| Get OneCall Forecast | Current and forecast weather data | latitudelongitudeapikey |
excludeunit_formatlanguage |
|
| Get Daily Forecasts 16 Days | Daily Forecast 16 Days is available at any location on the globe. | latitudelongitudeapikey |
numberunit_formatoutput_formatlanguage |
no output_formatsupport for HTML |
| Get Climatic Forecasts 30 Days | Climate Forecast 30 Days allows you to request daily weather data for the next 30 days | latitudelongitudeapikey |
numberunit_formatoutput_formatlanguage |
no output_formatsupport for HTML |
| Get Current Solar Radiation | Current solar radiation data | latitudelongitudeapikey |
||
| Get Solar Radiation Forecast | Forecast solar radiation data | latitudelongitudeapikey |
||
| Get Solar Radiation History | Historical solar radiation data for a from-to time span |
latitudelongitudeapikeydt_startdt_end |
||
| Get 5 Day 3 Hour Forecast | 5 day forecast is available at any location on the globe | latitudelongitudeapikey |
numberunit_formatoutput_formatlanguage |
no output_formatsupport for HTML |
| Get Current Air Pollution Radiation | Current air pollution data | latitudelongitudeapikey |
||
| Get Air Pollution Forecast | Air pollution data forecast | latitudelongitudeapikey |
||
| Get Air Pollution History | Historical Air Pollution data for a from-to time span |
latitudelongitudeapikeydt_startdt_end |
||
| Get Road Risk Data | Road Risk API provides weather data and national alerts at the point of destination and along a route |
latitudelongitudeapikeydt |
Known issues
- Not all OpenWeatherMap APIs have been assigned with corresponding Robot Framework keywords. What you see is what you get - at least for this version.
- The
Get Road Risk Datakeyword only supports a single set oflatitudeandlongitudevalues (the underlying API supports multiple sets)
Metadata
Release files for robotframework-openweathermap 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| robotframework_openweathermap-1.0.4.tar.gz | 22.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| robotframework_openweathermap-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.6 kB
Release files / robotframework_openweathermap-1.0.4.tar.gz
| Download URL | robotframework_openweathermap-1.0.4.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42fb877cf29f87240999321d56bb7d677b409ab211c6907a5f4dccf60db0198b
|
|
BLAKE2b-256 checksum How to use checksums |
5bf653939db51bf3406af8f47374a6e3cc83c33dbc566941369e9f18a61a2860
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / robotframework_openweathermap-1.0.4-py3-none-any.whl
| Download URL | robotframework_openweathermap-1.0.4-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de87585a08b92ee4080f92839381d5fe4ef1b77532e73b024e33963c6cc694d8
|
|
BLAKE2b-256 checksum How to use checksums |
81e877f2ec1cab8e9b1b4ab958c616bee3e0354332e603e1d7f14f1f8aa4b9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for robotframework-openweathermap 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.