Package: weather-data-retriever
Weather Data RetrieverA tool for retrieving weather data from multiple sources.(Currently supporting NASA's POWER Project and Open-Meteo)RequirementsPython VersionMain supported version:3.11Other supported versions:3.8,3.9,3.10Ensure one of these Python versions is installed on your computer.Environment & DependenciesTo install this repository, you have two options:Install as a project repository.Install directly from Pypu using pip within your preferred environment.Project InstallationEnsure Python is installed, then create a virtual environment and activate it:python3-mvenv/path/to/new/virtual/environmentsource/path/to/new/virtual/environment/bin/activateInstall dependencies with:pipinstall-rrequirements.txtPackage InstallationTo use it as a package within your project, execute:pipinstallweather-data-retrieverFunctionality OverviewThis package aggregates weather data from various open APIs into a simplified form. It utilizes:Nasa's weather open API (larc-power) and 'POWER' tools and applicationfor historical weather data across different aggregation levels and community cases.Open-Meteo's weather API collaborating with national weather services providing open datafor both historical and forecasted weather data from national weather services.NASA's POWER APIFetch historical weather data at various aggregation levels:AggregationClimatology:	Provides parameters as climatologies for a pre-defined period with monthly average, maximum, and/or minimum values available.Monthly:	Provides parameters by year; the annual and each month's average, maximum, and/or minimum values.Daily:	Provides parameters by day with average, maximum, and/or minimum values.Hourly:	Provides parameters by hour with average values.CommunitiesAG: The Agroclimatology (AG) solar and meteorological parameters are available as daily mean time series formats. All parameters are provided on the original resolution grid, which is dependent on the parameter. The daily time series include the basic solar and meteorology parameters to support agricultural decision support tools such as the Decision Support System for Agro-technology Transfer. The hourly time series is a smaller subset of the solar and meteorology parameters.RE: The Renewable Energy (RE) solar and meteorological parameters are available as climatologically and inter-annual (monthly and annual) averaged values, as well as in a daily time series format for user selected grids. All RE parameters are provided on the original resolution grid, which is dependent on the parameter. The climatologically averaged parameters are calculated to support applications such as solar cooking, sizing solar panels, and sizing battery backup systems. The monthly and annually averaged parameters are provided as monthly and annual averaged values by year for each of the base solar and meteorological data parameters. The daily and hourly time series include the basic solar and meteorology parameters as well as additional calculated parameters such as diffuse and direct normal radiation.SB: The Sustainable Buildings (SB) solar and meteorological parameters are available as climatologically, monthly, and annually average values, as well as in a daily time series format. All parameters are provided on the original resolution grid, which is dependent on the parameter. The climatologically averaged parameters are calculated to support the preliminary design and site selection for building projects. Monthly and annually averaged parameters are provided as monthly and annual averaged values by year. The daily time series include a range of the basic solar and meteorology parameters as well as additional calculated parameters such as diffuse and direct normal radiation, heating and cooling degree days, climate zones, etc. The hourly time series is a smaller subset of the solar and meteorology parameters.The current implementation of the package also supports "point", or "regional" cases. Point vase be used for cities, or small areas, or for geting data of the center of a country.Regional can be used for cases of geting data based on bounded boxes of a country in order to get the different values.The different variables that can be fetched are:"T2M": Temperature at 2 Meters (°C)"T2MDEW": Dew/Frost Point at 2 Meters (°C)"T2MWET": Wet Bulb Temperature at 2 Meters (°C)"TS": Earth Skin Temperature (°C)"T2M_RANGE": Temperature at 2 Meters Range (°C)"T2M_MAX": Temperature at 2 Meters Maximum (°C)"T2M_MIN": Temperature at 2 Meters Minimum (°C)"RH2M: Relative"Humidity at 2 Meters (%)"PRECTOTCORR": Precipitation Corrected (mm/day)"WS2M": Wind Speed at 2 Meters (m/s)"ALLSKY_SFC_SW_DWN": All Sky Surface Shortwave Downward Irradiance (kW-hr/m^2/day)Each aggregation level permits a specific set of variables to be used:
The "T2M", "T2MDEW", "T2MWET", "TS", "RH2M", "PRECTOT", "WS2M", and "ALLSKY SFC SW DWN" variables are the lowest-level variables that can be used in any of the aggregation levels. Additional "T2M RANGE," "T2M MAX," and "T2M MIN" can be utilized at all aggregation levels outside the hourly level.Statistics and availability of the data can be found atpower dashboard.Refer to thePOWER API Documentatiofor detailed information on available data types and thequick start notebookfor guidance.Open-Meteo APISuitable for accessing both historical and forecasted data:AggregationDaily:	Provides parameters by day with average, maximum, and/or minimum values.Hourly:	Provides parameters by hour with average values.The main different variables that can be fetched are:temperature_2m: Temperature at 2 Meters (°C)temperature_2m_max: Maximum daily air temperature at 2 meters above ground (°C)temperature_2m_min: Minimum daily air temperature at 2 meters above ground (°C)apparent_temperature: Apparent temperature (°C)apparent_temperature_max: Maximum daily apparent temperature (°C)apparent_temperature_min: Minimum daily apparent temperature (°C)relativehumidity_2m: Relative humidity at 2 meters above ground (%)dewpoint_2m: Dew point temperature at 2 meters above ground (°C)sunrise: Time of sunriseprecipitation: Total precipitation (rain, showers, snow) sum of the preceding hour (mm)precipitation_sum: Total precipitation sum (rain, showers, snow) (mm)rain_sum: 	Rain from large scale weather systems of the preceding hour in millimetersnowfall: Snowfall amount of the preceding hour in centimetersshowers: Showers from convective precipitation in millimeters from the preceding hourshowers_sum: Showers sum from convective precipitation in millimeterssnowfall_sum: Snowfall sum amount in centimetersEach aggregation level permits a specific set of variables to be used. In addition, more variables than the above are supported by this API. In order to choose your prefered ones to use, have a look athistorical weather apiand atforecast weather api.Open-Meteo's source code is available onGitHub.Please follow thequick start notebookin order to understand how to easily get started.LicenceOpen-Meteo APIs are free for non-commercial use. The access is not restricted, but it is asked for fair use.All data is provided as is without any warranty.API data are offered underAttribution 4.0 International (CC BY 4.0)You must include a link next to any location, Open-Meteo data are displayed like:<a href="https://open-meteo.com/">Weather data by Open-Meteo.com</a>How to contribute?We welcome any suggestions, problem reports, and contributions!
For any changes you would like to make to this project, we invite you to submit anissue.For more information, seeCONTRIBUTINGinstructions.ReferencesHow To Create a Python Package for Fetching Weather Data