biome-api-data: more consistent parsing

This commit is contained in:
Pavel Korytov 2023-07-07 21:05:37 +03:00
parent 3f1a95cb9c
commit d18723e76d
2 changed files with 5791 additions and 5760 deletions

View file

@ -34,16 +34,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("uv_index"
(:name . "UV Index")
@ -94,7 +94,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -447,9 +447,9 @@
(:type . checkbox))
("geopotential_height_30hPa"
(:name . "30 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -574,11 +574,11 @@
(:type . checkbox))
("soil_moisture_27_81cm"
(:name . "Soil Moisture (27-81 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -637,10 +637,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -679,7 +682,7 @@
("end_date"
(:type . date))
("timezone"
(:type . timezone)))))
(:type . timezone))))
((:param . "models")
(:name . "Weather models")
(:fields
@ -757,16 +760,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -820,7 +823,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -1173,9 +1176,9 @@
(:type . checkbox))
("geopotential_height_30hPa"
(:name . "30 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -1294,11 +1297,11 @@
(:type . checkbox))
("soil_moisture_27_81cm"
(:name . "Soil Moisture (27-81 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "minutely_15")
(:name . "15-Minutely Weather Variables")
(:children
(((:name . "Solar Radiation Variables")
((:name . "Solar Radiation Variables")
(:fields
("shortwave_radiation"
(:name . "Shortwave Solar Radiation")
@ -1329,9 +1332,9 @@
(:type . checkbox))
("terrestrial_radiation_instant"
(:name . "Terrestrial Solar Radiation (Instant)")
(:type . checkbox))))))
(:type . checkbox)))))
(:fields
(("precipitation"
("precipitation"
(:name . "Precipitation (rain + showers + snow)")
(:type . checkbox))
("rain"
@ -1351,11 +1354,11 @@
(:type . checkbox))
("lightning_potential"
(:name . "Lightning Potential Index LPI")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -1408,10 +1411,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -1446,7 +1452,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("NOAA GFS & HRRR"
(:name . "NOAA GFS & HRRR")
(:url . "https://open-meteo.com/en/docs/gfs-api")
@ -1455,16 +1461,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("uv_index"
(:name . "UV Index")
@ -1518,7 +1524,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -2205,9 +2211,9 @@
(:type . checkbox))
("geopotential_height_10hPa"
(:name . "10 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -2314,11 +2320,11 @@
(:type . checkbox))
("soil_moisture_100_to_200cm"
(:name . "Soil Moisture (100-200 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -2377,10 +2383,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -2419,7 +2428,7 @@
("end_date"
(:type . date))
("timezone"
(:type . timezone)))))))
(:type . timezone))))))
("MeteoFrance"
(:name . "MeteoFrance")
(:url . "https://open-meteo.com/en/docs/meteofrance-api")
@ -2428,16 +2437,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -2479,7 +2488,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -3101,9 +3110,9 @@
(:type . checkbox))
("geopotential_height_10hPa"
(:name . "10 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -3204,11 +3213,11 @@
(:type . checkbox))
("temperature_200m"
(:name . "Temperature (200 m)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -3267,10 +3276,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -3305,7 +3317,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))
(:type . date))))
((:param . "models")
(:name . "Weather models")
(:fields
@ -3338,18 +3350,18 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "3-Hourly Weather Variables")
(:children
(((:name . "Pressure Level Variables")
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -3609,9 +3621,9 @@
(:type . checkbox))
("divergence_of_wind_50hPa"
(:name . "50 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -3676,10 +3688,13 @@
(:type . checkbox))
("total_column_integrated_water_vapour"
(:name . "Total Column Integrated Water Vapour")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -3712,7 +3727,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("JMA"
(:name . "JMA")
(:url . "https://open-meteo.com/en/docs/jma-api")
@ -3721,16 +3736,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -3769,7 +3784,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_1000hPa"
(:name . "1000 hPa")
@ -4013,9 +4028,9 @@
(:type . checkbox))
("geopotential_height_100hPa"
(:name . "100 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -4068,11 +4083,11 @@
(:type . checkbox))
("winddirection_10m"
(:name . "Wind Direction (10 m)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -4119,10 +4134,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -4157,7 +4175,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("MET Norway"
(:name . "MET Norway")
(:url . "https://open-meteo.com/en/docs/metno-api")
@ -4166,16 +4184,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -4211,9 +4229,9 @@
(:type . checkbox))
("terrestrial_radiation_instant"
(:name . "Terrestrial Solar Radiation (Instant)")
(:type . checkbox))))))
(:type . checkbox)))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -4260,10 +4278,13 @@
(:type . checkbox))
("windgusts_10m"
(:name . "Wind Gusts (10 m)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -4298,7 +4319,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("GEM"
(:name . "GEM")
(:url . "https://open-meteo.com/en/docs/gem-api")
@ -4307,16 +4328,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -4358,7 +4379,7 @@
(:type . checkbox))))
((:name . "Pressure Level Variables")
(:children
(((:name . "Temperature")
((:name . "Temperature")
(:fields
("temperature_10hPa"
(:name . "10 hPa")
@ -5022,9 +5043,9 @@
(:type . checkbox))
("geopotential_height_1015hPa"
(:name . "1015 hPa")
(:type . checkbox)))))))))
(:type . checkbox)))))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -5116,11 +5137,11 @@
(:type . checkbox))
("soil_moisture_0_to_10cm"
(:name . "Soil Moisture (0-10 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -5170,10 +5191,13 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -5208,7 +5232,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("Historical Weather"
(:name . "Historical Weather")
(:url . "https://open-meteo.com/en/docs/historical-weather-api")
@ -5217,16 +5241,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("is_day"
(:name . "Is Day or Night")
@ -5244,9 +5268,9 @@
(:type . checkbox))
("direct_normal_irradiance"
(:name . "Direct Normal Irradiance DNI")
(:type . checkbox))))))
(:type . checkbox)))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -5335,11 +5359,11 @@
(:type . checkbox))
("soil_moisture_100_to_255cm"
(:name . "Soil Moisture (100-255 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:fields
(("weathercode"
("weathercode"
(:name . "Weathercode")
(:type . checkbox))
("temperature_2m_max"
@ -5395,16 +5419,19 @@
(:type . checkbox))
("et0_fao_evapotranspiration"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Specify Time Interval")
(:fields
(("start_date"
("start_date"
(:type . date))
("end_date"
(:type . date)))))
(:type . date))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -5431,7 +5458,7 @@
("iso8601" . "ISO 8601 (e.g. 2022-12-31)")
("unixtime" . "Unix timestamp")))
("timezone"
(:type . timezone)))))
(:type . timezone))))
((:param . "models")
(:name . "Reanalysis models")
(:fields
@ -5455,16 +5482,16 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "hourly")
(:name . "Hourly Weather Variables")
(:children
(((:name . "Additional Variables")
((:name . "Additional Variables")
(:fields
("uv_index"
(:name . "UV Index")
@ -5503,9 +5530,9 @@
(:type . checkbox))
("direct_normal_irradiance_instant"
(:name . "Direct Normal Irradiance DNI (Instant)")
(:type . checkbox))))))
(:type . checkbox)))))
(:fields
(("temperature_2m"
("temperature_2m"
(:name . "Temperature (2 m)")
(:type . checkbox))
("relativehumidity_2m"
@ -5603,10 +5630,13 @@
(:type . checkbox))
("soil_moisture_100_to_200cm"
(:name . "Soil Moisture (100-400 cm)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("temperature_unit"
("elevation"
(:name . "Elevation")
(:type . float))
("temperature_unit"
(:name . "Temperature Unit")
(:type . select)
(:options
@ -5645,11 +5675,11 @@
("end_date"
(:type . date))
("timezone"
(:type . timezone)))))
(:type . timezone))))
((:param . "models")
(:name . "Ensemble Models")
(:fields
(("icon_seamless"
("icon_seamless"
(:name . "DWD Icon EPS Seamless")
(:type . checkbox))
("icon_global"
@ -5675,7 +5705,7 @@
(:type . checkbox))
("gem_global"
(:name . "GEM Global Ensemble")
(:type . checkbox)))))))
(:type . checkbox))))))
("Climate Change"
(:name . "Climate Change")
(:url . "https://open-meteo.com/en/docs/climate-api")
@ -5684,17 +5714,17 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:children nil)
(:children)
(:fields
(("temperature_2m_mean"
("temperature_2m_mean"
(:name . "Mean Temperature (2 m)")
(:type . checkbox))
("temperature_2m_max"
@ -5750,16 +5780,16 @@
(:type . checkbox))
("et0_fao_evapotranspiration_sum"
(:name . "Reference Evapotranspiration (ET₀)")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Specify Time Interval")
(:fields
(("start_date"
("start_date"
(:type . date))
("end_date"
(:type . date)))))
(:type . date))))
((:name . "Settings")
(:fields
(("disable_bias_correction"
("disable_bias_correction"
(:name . "Raw data. Disable statistical downscaling with ERA5-Land (10 km)")
(:type . checkbox))
("temperature_unit"
@ -5787,7 +5817,7 @@
(:type . select)
(:options
("iso8601" . "ISO 8601 (e.g. 2022-12-31)")
("unixtime" . "Unix timestamp"))))))
("unixtime" . "Unix timestamp")))))
((:param . "models")
(:name . "Climate models")
(:fields
@ -5820,15 +5850,15 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:name . "Hourly Marine Variables")
(:fields
(("wave_height"
("wave_height"
(:name . "Wave Height")
(:type . checkbox))
("wave_direction"
@ -5860,10 +5890,10 @@
(:type . checkbox))
("swell_wave_peak_period"
(:name . "Swell Wave Peak Period")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Daily Marine Variables")
(:fields
(("wave_height_max"
("wave_height_max"
(:name . "Wave Height Max")
(:type . checkbox))
("wave_direction_dominant"
@ -5895,10 +5925,10 @@
(:type . checkbox))
("swell_wave_peak_period_max"
(:name . "Swell Wave Peak Period Max")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("timezone"
("timezone"
(:type . timezone))
("length_unit"
(:name . "Length Unit")
@ -5919,7 +5949,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("Air Quality"
(:name . "Air Quality")
(:url . "https://open-meteo.com/en/docs/air-quality-api")
@ -5928,15 +5958,15 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:name . "Hourly Air Quality Variables")
(:children
(((:name . "European Air Quality Index")
((:name . "European Air Quality Index")
(:fields
("european_aqi"
(:name . "European AQI")
@ -5978,9 +6008,9 @@
(:type . checkbox))
("us_aqi_so2"
(:name . "United States AQI SO")
(:type . checkbox))))))
(:type . checkbox)))))
(:fields
(("pm10"
("pm10"
(:name . "Particulate Matter PM")
(:type . checkbox))
("pm2_5"
@ -6030,10 +6060,10 @@
(:type . checkbox))
("ragweed_pollen"
(:name . "Ragweed Pollen")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("domains"
("domains"
(:name . "Domain")
(:type . select)
(:options
@ -6055,7 +6085,7 @@
("start_date"
(:type . date))
("end_date"
(:type . date)))))))
(:type . date))))))
("Flood"
(:name . "Flood")
(:url . "https://open-meteo.com/en/docs/flood-api")
@ -6064,17 +6094,17 @@
(:sections
((:name . "Select Coordinates or City")
(:fields
(("latitude"
("latitude"
(:name . "Latitude")
(:type . float))
("longitude"
(:name . "Longitude")
(:type . float)))))
(:type . float))))
((:param . "daily")
(:name . "Daily Weather Variables")
(:children nil)
(:children)
(:fields
(("river_discharge"
("river_discharge"
(:name . "River Discharge")
(:type . checkbox))
("river_discharge_mean"
@ -6097,10 +6127,10 @@
(:type . checkbox))
("ensemble"
(:name . "All 50 Ensemble Members")
(:type . checkbox)))))
(:type . checkbox))))
((:name . "Settings")
(:fields
(("start_date"
("start_date"
(:type . date))
("end_date"
(:type . date))
@ -6117,7 +6147,7 @@
(:type . select)
(:options
("iso8601" . "ISO 8601 (e.g. 2022-12-31)")
("unixtime" . "Unix timestamp"))))))
("unixtime" . "Unix timestamp")))))
((:param . "models")
(:name . "Flood Models")
(:fields
@ -6139,7 +6169,7 @@
("consolidated_v4"
(:name . "GloFAS v4 Consolidated")
(:type . checkbox)))))))
"Open-meteo API docs data.\nCheck `biome-api-parse--page' for the format.")
"open-meteo API docs data.\nCheck `biome-api-parse--page' for the format.")
(defconst biome-api-timezones

View file

@ -133,11 +133,11 @@
"Replace these variable defintions with the given ones.")
(defconst biome-api-parse--add-settings
`((:param . ("elevation" . ((:name . "Elevation")
`(((:param . ("elevation" . ((:name . "Elevation")
(:type . float))))
(:pages . ("Weather Forecast" "DWD ICON" "NOAA GFS & HRRR"
"MeteoFrance" "ECMWF" "JMA" "MET Norway" "GEM" "Historical Weather"
"Ensemble Models"))))
"Ensemble Models")))))
(defun biome-api-parse--fix-string (string)
"Remove extra spaces and newlines from STRING."
@ -215,7 +215,6 @@ Return a list of sections as defined by `biome-api-parse--page'."
(lambda (el)
(and (eq (dom-tag el) 'button)
(string-match-p "nav-link" (dom-attr el 'class))))))))
(list
(cl-loop for (id . name) in pill-names
collect `((:name . ,name)
(:fields
@ -224,7 +223,7 @@ Return a list of sections as defined by `biome-api-parse--page'."
(car (dom-search
section
(lambda (el)
(string= (dom-attr el 'id) id)))))))))))
(string= (dom-attr el 'id) id))))))))))
(defun biome-api-parse--page-accordion (section)
"Parse bootstrap accordion from SECTION.
@ -251,9 +250,9 @@ Return a list of sections as defined by `biome-api-parse--page'."
The return value is as defined by `biome-api-parse--page'."
(or (when-let ((accordion (biome-api-parse--page-accordion section)))
(list (cons :children accordion)))
`((:children . ,accordion)))
(when-let ((variables (biome-api-parse--page-variables section)))
(list (cons :fields variables)))))
`((:fields . ,variables)))))
(defun biome-api-parse--postprocess-extract-section (sections section-name &optional remove)
"Extract section with SECTION-NAME from SECTIONS.
@ -278,10 +277,10 @@ is removed from the sections list."
(mapcar (lambda (item)
(when (assoc :children item)
(let ((extracted (biome-api-parse--postprocess-extract-section
(cadr (assoc :children item))
(cdr (assoc :children item))
section-name remove)))
(when remove
(setf (cadr (assoc :children item)) (car extracted)) )
(setf (cdr (assoc :children item)) (car extracted)) )
(when (cdr extracted)
(setq models (cdr extracted)))))
item)
@ -377,15 +376,17 @@ fields attributes as cdr:
(biome-api-parse--fix-string
(dom-text (car h2s))))))
if (string= section-name "Usage License") return (nreverse res)
;; if (string= section-name "Hourly Weather Variables") return (nreverse res)
;; Merge different sections with the same name
unless (assoc section-name res)
do (push `(,section-name . nil) res)
do (let ((parsed-section (biome-api-parse--section section)))
(cl-loop for (kind . data) in parsed-section
(cl-loop
for (kind . data) in parsed-section
unless (assoc kind (cdr (assoc section-name res)))
do (push `(,kind . nil) (cdr (assoc section-name res)))
do (setf (cdr (assoc kind (cdr (assoc section-name res))))
(cons data (cdr (assoc kind (cdr (assoc section-name res))))))))
(append data (cdr (assoc kind (cdr (assoc section-name res))))))))
finally return (nreverse res))))
(biome-api-parse--postprocess sections name)))