robotframework-openweathermap


Namerobotframework-openweathermap JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/joergschultzelutter/robotframework-openweathermap
SummaryRobot Framework keywords for the 'OpenWeatherMap' library
upload_time2024-04-26 20:34:47
maintainerNone
docs_urlNone
authorJoerg Schultze-Lutter
requires_pythonNone
licenseGNU General Public License v3 (GPLv3)
keywords robot framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # robotframework-openweathermap

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![CodeQL](https://github.com/joergschultzelutter/robotframework-openweathermap/actions/workflows/codeql.yml/badge.svg)](https://github.com/joergschultzelutter/robotframework-openweathermap/actions/workflows/codeql.yml) [![PyPi version](https://img.shields.io/pypi/v/robotframework-openweathermap.svg)](https://pypi.python.org/pypi/robotframework-openweathermap)

```robotframework-openweathermap``` is a [Robot Framework](https://www.robotframework.org) keyword collection for the [OpenWeatherMap](https://www.openweathermap.org/api) 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](https://github.com/joergschultzelutter/robotframework-openweathermap/blob/master/tests/keyword_checks.robot) relies on two requirements: 

- [get an OpenWeatherMap API key](https://home.openweathermap.org/users/sign_up) (it's free)
- create an environment variable ```OWM_API_KEY``` and 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 ```Getter``` and ```Setter``` keywords, e.g, ```Set OpenWeatherMap Latitude```
- Each OpenWeatherMap Keyword also permits the usage of these parameters. Example:

```robot
Get Current Weather   latitude=....
```
- A keyword's parameter value has priority over the ```Setter``` value. This means that if you use ```Set OpenWeathermap Latitude  10``` and ```Get Current Weather  latitude=20```, the value from the OWK Keyword will supersede the ``Setter`` keyword and a value of ```20``` is 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

```robot
*** Settings ***

Library  OpenWeatherMapLibrary  51.82798  9.4455  ...

*** Test Cases ***
My first test case
```

#### Option 2 - set as named parameters

```robot
*** Settings ***

Library  OpenWeatherMapLibrary  latitude=51.82798  longitude=9.4455  ...

*** Test Cases ***
My first test case
```

#### Option 3 - Use Robot Keywords
```robot
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](https://openweathermap.org/current#multi)<br />for valid values |
| ``Get``/``Set OpenWeatherMap Excludes``          | Gets / Sets the exclude(s) value.<br /> Separarate multiple values with a comma<br />See [API documentation](https://openweathermap.org/api/one-call-api) for details | ``exclude``       | ``current``<br />``minutely``<br />``hourly``<br />``daily``<br />``alerts``             |
| ``Get``/``Set OpenWeatherMap Output Format``     | Gets / Sets the output format (e.g. ``json``)                                                                                                                         | ``output_format`` | ``json``<br />``xml``<br />``html``                                                      |
| ``Get``/``Set OpenWeatherMap Unit Format``       | Gets / Sets the unit format<br />See [API Documentation](https://openweathermap.org/api/one-call-api#data) for details<br />Format availability depends on API call   | ``unit_format``   | ``standard``<br />``metric``<br >``imperial``                                            |
| ``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<br />parameters | Optional<br />parameters | Comments                              |
| ------- | ----------- | -------------------- | ------------------- |---------------------------------------|
| [Get Current Weather](https://openweathermap.org/current) | Access current weather data for any location on<br />Earth including over 200,000 cities | ``latitude``<br />``longitude``<br />``apikey``|``output_format``<br />``unit_format``<br />``language`` |                                       | 
| [Get Hourly Forecast 4 Days](https://openweathermap.org/api/hourly-forecast) | Hourly forecast for 4 days (96 timestamps) | ``latitude``<br />``longitude``<br />``apikey``|``output_format``<br />``number``<br />``language`` | no ``output_format``<br />support for HTML |
| [Get OneCall Forecast](https://openweathermap.org/api/one-call-api) | Current and forecast weather data | ``latitude``<br />``longitude``<br />``apikey``|``exclude``<br />``unit_format``<br />``language`` |                                       |
| [Get Daily Forecasts 16 Days](https://openweathermap.org/forecast16) | Daily Forecast 16 Days is available at any location on the globe. | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |
| [Get Climatic Forecasts 30 Days](https://openweathermap.org/forecast30) | Climate Forecast 30 Days allows you to request daily weather data for the next 30 days | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |
| [Get Current Solar Radiation](https://openweathermap.org/api/solar-radiation) | Current solar radiation data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |
| [Get Solar Radiation Forecast](https://openweathermap.org/api/solar-radiation) | Forecast solar radiation data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |
| [Get Solar Radiation History](https://openweathermap.org/api/solar-radiation) | Historical solar radiation data<br />for a from-to time span | ``latitude``<br />``longitude``<br />``apikey``<br />``dt_start``<br />``dt_end``| |                                       |
| [Get 5 Day 3 Hour Forecast](https://openweathermap.org/forecast5) | 5 day forecast is available at any location on the globe | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |
| [Get Current Air Pollution Radiation](https://openweathermap.org/api/air-pollution) | Current air pollution data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |
| [Get Air Pollution Forecast](https://openweathermap.org/api/air-pollution) | Air pollution data forecast | ``latitude``<br />``longitude``<br />``apikey``| |                                       |
| [Get Air Pollution History](https://openweathermap.org/api/air-pollution) | Historical Air Pollution data<br />for a from-to time span | ``latitude``<br />``longitude``<br />``apikey``<br />``dt_start``<br />``dt_end``| |                                       |
| [Get Road Risk Data](https://openweathermap.org/api/road-risk) | Road Risk API provides weather data<br />and national alerts at the point of<br />destination and along a route | ``latitude``<br />``longitude``<br />``apikey``<br />``dt``| |                                       |


## 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 Data`` keyword only supports a single set of ``latitude`` and ``longitude`` values (the underlying API supports multiple sets)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/joergschultzelutter/robotframework-openweathermap",
    "name": "robotframework-openweathermap",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Robot Framework",
    "author": "Joerg Schultze-Lutter",
    "author_email": "joerg.schultze.lutter@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5b/f6/53939db51bf3406af8f47374a6e3cc83c33dbc566941369e9f18a61a2860/robotframework_openweathermap-1.0.4.tar.gz",
    "platform": null,
    "description": "# robotframework-openweathermap\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![CodeQL](https://github.com/joergschultzelutter/robotframework-openweathermap/actions/workflows/codeql.yml/badge.svg)](https://github.com/joergschultzelutter/robotframework-openweathermap/actions/workflows/codeql.yml) [![PyPi version](https://img.shields.io/pypi/v/robotframework-openweathermap.svg)](https://pypi.python.org/pypi/robotframework-openweathermap)\n\n```robotframework-openweathermap``` is a [Robot Framework](https://www.robotframework.org) keyword collection for the [OpenWeatherMap](https://www.openweathermap.org/api) API.\n\n## Installation\n\nThe easiest way is to install this package is from pypi:\n\n    pip install robotframework-openweathermap\n\n## Robot Framework Library Examples\n\nPrerequisites:\n\nThe accompanying Robot Framework [test file](https://github.com/joergschultzelutter/robotframework-openweathermap/blob/master/tests/keyword_checks.robot) relies on two requirements: \n\n- [get an OpenWeatherMap API key](https://home.openweathermap.org/users/sign_up) (it's free)\n- create an environment variable ```OWM_API_KEY``` and assign the OpenWeatherMap API key to that variable\n- Execute test with ``robot keyword_checks.robot``\n\n## Library usage and supported keywords\n\n### Default settings \n\nThe following rules apply:\n\n- The default value for each parameter is ```None```\n- Each parameter supports ```Getter``` and ```Setter``` keywords, e.g, ```Set OpenWeatherMap Latitude```\n- Each OpenWeatherMap Keyword also permits the usage of these parameters. Example:\n\n```robot\nGet Current Weather   latitude=....\n```\n- A keyword's parameter value has priority over the ```Setter``` value. This means that if you use ```Set OpenWeathermap Latitude  10``` and ```Get Current Weather  latitude=20```, the value from the OWK Keyword will supersede the ``Setter`` keyword and a value of ```20``` is going to be used.  \n\n### Options for setting the parameter values\n\nYou can either specify all parameters during the initial setup of the library or alternatively via separate keywords\n\n#### Option 1 - set as position parameters\n\n```robot\n*** Settings ***\n\nLibrary  OpenWeatherMapLibrary  51.82798  9.4455  ...\n\n*** Test Cases ***\nMy first test case\n```\n\n#### Option 2 - set as named parameters\n\n```robot\n*** Settings ***\n\nLibrary  OpenWeatherMapLibrary  latitude=51.82798  longitude=9.4455  ...\n\n*** Test Cases ***\nMy first test case\n```\n\n#### Option 3 - Use Robot Keywords\n```robot\nSet OpenWeatherMap Latitude   latitude=51.82798\n```\n\n### Generic Getter / Setter Robot Keywords supported by this library\n\nYou 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.\n\n\n| Keyword                                          | Description                                                                                                                                                           | Arguments         | Valid Values                                                                             |\n|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|------------------------------------------------------------------------------------------|\n| ``Get``/``Set OpenWeatherMap Latitude``          | Gets / Sets the latitude value                                                                                                                                        | ``latitude``      | float value                                                                              |\n| ``Get``/``Set OpenWeatherMap Longitude``         | Gets / Sets the longitude value                                                                                                                                       | ``longitude``     | float value                                                                              |\n| ``Get``/``Set OpenWeatherMap API Key``           | Gets / Sets the OWM API Key                                                                                                                                           | ``apikey``        | string                                                                                   |\n| ``Get``/``Set OpenWeatherMap Number Of Results`` | Gets / Sets the max number of results                                                                                                                                 | ``number``        | integer > 0                                                                              |\n| ``Get``/``Set OpenWeatherMap Language``          | Gets / Sets the desired output language                                                                                                                               | ``language``      | see [OpenWeatherMap API](https://openweathermap.org/current#multi)<br />for valid values |\n| ``Get``/``Set OpenWeatherMap Excludes``          | Gets / Sets the exclude(s) value.<br /> Separarate multiple values with a comma<br />See [API documentation](https://openweathermap.org/api/one-call-api) for details | ``exclude``       | ``current``<br />``minutely``<br />``hourly``<br />``daily``<br />``alerts``             |\n| ``Get``/``Set OpenWeatherMap Output Format``     | Gets / Sets the output format (e.g. ``json``)                                                                                                                         | ``output_format`` | ``json``<br />``xml``<br />``html``                                                      |\n| ``Get``/``Set OpenWeatherMap Unit Format``       | Gets / Sets the unit format<br />See [API Documentation](https://openweathermap.org/api/one-call-api#data) for details<br />Format availability depends on API call   | ``unit_format``   | ``standard``<br />``metric``<br >``imperial``                                            |\n| ``Get``/``Set OpenWeatherMap Datetime Start``    | Gets / Sets the start datetime for date ranges                                                                                                                        | ``dt_start``      | Unix timestamp                                                                           |\n| ``Get``/``Set OpenWeatherMap Datetime End``      | Gets / Sets the end datetime for date ranges                                                                                                                          | ``dt_end``        | Unix timestamp                                                                           |\n| ``Get``/``Set OpenWeatherMap Datetime``          | Gets / Sets a single point in time                                                                                                                                    | ``dt``            | Unix Timestamp                                                                           |\n\n## OpenWeatherMap Keywords\n\nPlease 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.\n\nEach 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. \n\n| Keyword | Description | Mandatory<br />parameters | Optional<br />parameters | Comments                              |\n| ------- | ----------- | -------------------- | ------------------- |---------------------------------------|\n| [Get Current Weather](https://openweathermap.org/current) | Access current weather data for any location on<br />Earth including over 200,000 cities | ``latitude``<br />``longitude``<br />``apikey``|``output_format``<br />``unit_format``<br />``language`` |                                       | \n| [Get Hourly Forecast 4 Days](https://openweathermap.org/api/hourly-forecast) | Hourly forecast for 4 days (96 timestamps) | ``latitude``<br />``longitude``<br />``apikey``|``output_format``<br />``number``<br />``language`` | no ``output_format``<br />support for HTML |\n| [Get OneCall Forecast](https://openweathermap.org/api/one-call-api) | Current and forecast weather data | ``latitude``<br />``longitude``<br />``apikey``|``exclude``<br />``unit_format``<br />``language`` |                                       |\n| [Get Daily Forecasts 16 Days](https://openweathermap.org/forecast16) | Daily Forecast 16 Days is available at any location on the globe. | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |\n| [Get Climatic Forecasts 30 Days](https://openweathermap.org/forecast30) | Climate Forecast 30 Days allows you to request daily weather data for the next 30 days | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |\n| [Get Current Solar Radiation](https://openweathermap.org/api/solar-radiation) | Current solar radiation data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |\n| [Get Solar Radiation Forecast](https://openweathermap.org/api/solar-radiation) | Forecast solar radiation data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |\n| [Get Solar Radiation History](https://openweathermap.org/api/solar-radiation) | Historical solar radiation data<br />for a from-to time span | ``latitude``<br />``longitude``<br />``apikey``<br />``dt_start``<br />``dt_end``| |                                       |\n| [Get 5 Day 3 Hour Forecast](https://openweathermap.org/forecast5) | 5 day forecast is available at any location on the globe | ``latitude``<br />``longitude``<br />``apikey``|``number``<br />``unit_format``<br />``output_format``<br />``language`` | no ``output_format``<br />support for HTML |\n| [Get Current Air Pollution Radiation](https://openweathermap.org/api/air-pollution) | Current air pollution data | ``latitude``<br />``longitude``<br />``apikey``| |                                       |\n| [Get Air Pollution Forecast](https://openweathermap.org/api/air-pollution) | Air pollution data forecast | ``latitude``<br />``longitude``<br />``apikey``| |                                       |\n| [Get Air Pollution History](https://openweathermap.org/api/air-pollution) | Historical Air Pollution data<br />for a from-to time span | ``latitude``<br />``longitude``<br />``apikey``<br />``dt_start``<br />``dt_end``| |                                       |\n| [Get Road Risk Data](https://openweathermap.org/api/road-risk) | Road Risk API provides weather data<br />and national alerts at the point of<br />destination and along a route | ``latitude``<br />``longitude``<br />``apikey``<br />``dt``| |                                       |\n\n\n## Known issues\n\n- Not all OpenWeatherMap APIs have been assigned with corresponding Robot Framework keywords. What you see is what you get - at least for this version.\n- The ``Get Road Risk Data`` keyword only supports a single set of ``latitude`` and ``longitude`` values (the underlying API supports multiple sets)\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "Robot Framework keywords for the 'OpenWeatherMap' library",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/joergschultzelutter/robotframework-openweathermap"
    },
    "split_keywords": [
        "robot",
        "framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81e877f2ec1cab8e9b1b4ab958c616bee3e0354332e603e1d7f14f1f8aa4b9e8",
                "md5": "3828a9d75cb82eb2a1bfbe0a1a38d441",
                "sha256": "de87585a08b92ee4080f92839381d5fe4ef1b77532e73b024e33963c6cc694d8"
            },
            "downloads": -1,
            "filename": "robotframework_openweathermap-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3828a9d75cb82eb2a1bfbe0a1a38d441",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22363,
            "upload_time": "2024-04-26T20:34:46",
            "upload_time_iso_8601": "2024-04-26T20:34:46.100869Z",
            "url": "https://files.pythonhosted.org/packages/81/e8/77f2ec1cab8e9b1b4ab958c616bee3e0354332e603e1d7f14f1f8aa4b9e8/robotframework_openweathermap-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5bf653939db51bf3406af8f47374a6e3cc83c33dbc566941369e9f18a61a2860",
                "md5": "2c5f611b1756466aaaec35637c1cc0a5",
                "sha256": "42fb877cf29f87240999321d56bb7d677b409ab211c6907a5f4dccf60db0198b"
            },
            "downloads": -1,
            "filename": "robotframework_openweathermap-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2c5f611b1756466aaaec35637c1cc0a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22233,
            "upload_time": "2024-04-26T20:34:47",
            "upload_time_iso_8601": "2024-04-26T20:34:47.489348Z",
            "url": "https://files.pythonhosted.org/packages/5b/f6/53939db51bf3406af8f47374a6e3cc83c33dbc566941369e9f18a61a2860/robotframework_openweathermap-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 20:34:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "joergschultzelutter",
    "github_project": "robotframework-openweathermap",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "robotframework-openweathermap"
}
        
Elapsed time: 0.25751s