ellisvalentiner / steampipe-plugin-weatherkit

Use SQL to instantly query WeatherKit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WeatherKit Plugin for Steampipe

Note: WeatherKit REST API is in beta. Contributes are welcome to fix issues that may arise as the API changes or other improvements to the plugin.

Quick start

Install the plugin with Steampipe:

steampipe plugin install ellisvalentiner/weatherkit

Get the current temperature and condition:

select
  as_of,
  temperature,
  condition_code
from
  weatherkit_current_weather
where
  latitude = '42.281'
  and longitude = '-83.743';

Get the precipitation forecast:

select
  forecast_start::date as forecast_date,
  precipitation_chance,
  precipitation_amount
from
  weatherkit_daily_forecast
where
  latitude = '42.281'
  and longitude = '-83.743'
order by
  forecast_date;

Developing

Prerequisites:

  • Steampipe
  • Golang

Clone:

git clone https://github.com/ellisvalentiner/steampipe-plugin-weatherkit.git
cd steampipe-plugin-weatherkit

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
nano ~/.steampipe/config/weatherkit.spc

Try it!

steampipe query
> .inspect weatherkit

Legal

Apple Weather and Weather are trademarks of Apple Inc.

Data Sources

About

Use SQL to instantly query WeatherKit.

License:Apache License 2.0


Languages

Language:Go 97.4%Language:PLSQL 2.3%Language:Makefile 0.3%