Plugin information
Version | 1.0.1 |
---|---|
Author | Dataiku (Henri Chabert) |
Released | 2020-06-01 |
Last updated | 2020-06-01 |
License | Apache Software License |
Source code | Github |
Reporting issues | Github |
How to set up
General set up
- Create an OpenWeatherMap account here.
- Login to the platform and go on the API keys tab
- Use the Default key or create a new one. Copy the key.
- In DSS, go to App > Plugins > Installed > OpenWeatherMap > Settings > OpenWeatherMap API configuration
- Add a new preset, name it and fill in the details:
- System of units: The default system of units you want to use (It can be overwritten when running the recipe)
- Language: Language of the text describing the weather (It can be overwritten when running the recipe).
Cache set up
The OpenWeatherMap plugin uses a cache system to store data locally, in order to avoid repeating identical queries. You can change preferences by following the following steps:
- In DSS, go to App > Plugins > Installed > OpenWeatherMap > Settings > Parameters
- Choose the cache storage location between the following options:
- User $HOME directory (Default): The cache will be stored under the folder $HOME/.cache/dss/plugins/open_weather_map
- Custom: You can choose a custom location. Write in the input below the absolute location (Example: /Users/johnsnow/Documents/dss_cache). Be cautious using this with an UIF instance as permission errors could occur
- None: Do not use a cache
- Choose the cache parameters:
- Cache size (in MegaBytes): The maximum size of the cache file (Default is 1Go)
- Cache eviction policy: The way you want the data to be deleted once the maximum size is reached. You have the choice between three modes:
- Least Recently Stored: Delete the oldest cache records first
- Least recently Used: Deleted cache records that weren’t used for the longest time
- Least Frequently Used: Deleted cache records that are the least frequently used
- No eviction: Overwrite cache size, the cache will grow without bounds
How to use
The plugin is made of two main components:
- A connector that allows you to retrieve the data directly from OpenWeatherMap API and put it in a new dataset.
- A recipe that allows you to add weather information to your data containing lat/lon and data column
OpenWeatherMap connector
- Go to your DSS flow
- Select OpenWeatherMap in the plugin section of the dataset menu
- Click on OpenWeatherMap weather generating
- Pick a preset of parameters
- Write the latitude and the longitude of the location you want the weather of
- Choose the desired granularity
- Daily information are available 5 days in the past and 7 days in the future. The output dataset is 12 rows long
- Hourly information are available 5 days in the past and 2 days in the future. The output dataset is 168 rows long
Advanced mode
You can configure more settings by checking “Advanced mode”. The available options are:
- Data type: You can choose whether you wish to have historical data, forecast data or both (Default is both)
- System of units: It overwrites the settings of the preset for this specific job
- Language: It overwrites the settings of the preset for this specific job
- Use cache: It overwrites the settings of the preset for this specific job
- Parse output JSON: If you prefer to get a unique column containing the entire response in JSON format, you can check this
OpenWeatherMap recipe
- Go to your DSS flow
- Select OpenWeatherMap in the plugin section of the recipe menu
- Click on OpenWeatherMap Weather mapping
- Select the input dataset and the output dataset, and then click on “CREATE”
- Fill in the latitude and longitude columns
- Select whether you need the current weather or the weather at a date provided by a column (having date format)
- Run the recipe
In addition of the weather data, a column named “error” will be added to the output dataset. If something went wrong when retrieving the data for the specific pair location/date, this column will tell you what it is. The errors usually come from the fact that the date is not in the available range [today – 5 days ; today + 7 days] or that you reached your API calls limit.
Advanced mode
You can configure more settings by checking “Advanced mode”. The available options are:
- System of units: It overwrites the settings of the preset for this specific job
- Language: It overwrites the settings of the preset for this specific job
- Use cache: It overwrites the settings of the preset for this specific job
- Parse output JSON: If you prefer to get a unique column containing the entire response in JSON format, you can check this. You should check this option if you use the option “Append instead of overwrite”