![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
.. image:: https://img.shields.io/pypi/v/dwdGribExtractor.svg :target: https://img.shields.io/pypi/v/dwdGribExtractor
dwdGribExtractor is a smart package to easely extract data from numerical weather prediction <https://www.dwd.de/EN/ourservices/nwp_forecast_data/nwp_forecast_data.html>
_
grib files provided by DWD.
The difference to other packages is the location flexibility. So every point
on the 2.2km x 2.2km grid (ICON-D2) can be retrieved for the next X forecast hours.
At the moment only ICON_D2 is supported.
For currently available weather variabels see: ICON User Manual <https://www.dwd.de/SharedDocs/downloads/DE/modelldokumentationen/nwv/icon/icon_dbbeschr_aktuell.pdf?view=nasPublication&nn=495490/>
_
Chapter 6.1.4 table 6.4
Install with pip::
$ pip install dwdGrilbExtractor
To read the grib2 files xarray <http://xarray.pydata.org/en/stable/>
_ with cfgrib <https://github.com/ecmwf/cfgrib/>
_ engine is used.
The easiest way to install cfgrib and all its binary dependencies is via Conda <https://conda.io/>
_::
$ conda install -c conda-forge cfgrib
alternatively, if you install the binary dependencies yourself, you can install the Python package from PyPI with::
$ pip install cfgrib
cfgrib depends on the eccodes python package <https://pypi.org/project/eccodes>
_
to access the ECMWF ecCodes binary library,
when not using conda please follow the System dependencies section there.
It is strongly recommended to use Unix enironment running dwdGrib2location. For
windows several issues may appear. At the moment dwdGrib2location is tested
with Windows10 and works if following requirements are satiesfied.
To build eccodes on windows by your own should be avoided. The easiest way to
use eccodes on windows is to install it in an MSYS <https://www.msys2.org/>
_ environment.
Install MSYS
Install eccodes <https://packages.msys2.org/base/mingw-w64-eccodes>
_. Depending on your system run in the MSYS cli::
$ pacman -S mingw-w64-ucrt-x86_64-eccodes
Set environment variables::
ECCODES_DIR = <path_to_ecccodes_install_dir> e.g (C:\msys64\ucrt64) ECCODES_DEFINITION_PATH = <path_to_eccodes_definitions> (e.g C:\msys64\ucrt64\share\eccodes\definitions)
Add eccodes to path. This is the folder inside the MSYS environment where the .exe files are located::
e.g. C:\msys64\ucrt64\bin
Install ecCodes::
$ pip install eccodes
Install cfgrib::
$ pip install cfgrib
Check if cfgrib is working::
$ python -m cfgrib selfcheck Found: ecCodes v2.20.0. Your system is ready.
build it by your own <https://gist.github.com/MHBalsmeier/a01ad4e07ecf467c90fad2ac7719844a>
_
TODO.. code-block:: python
locationList = {
"Vienna": {
"lat": 48.20,
"lon": 16.37
},
"Graz": {
"lat": 47.07,
"lon": 15.43
}
}
variables = ["aswdir_s", "aswdifd_s", "t_2m"]
forecast = ICON_D2(locations = locationList, forecastHours = 3)
data = forecast.collectData(varList = variables, cores = None) # Disable multiprocessing
#data = forecast.collectData(varList = variables, cores = 4)
#### Indexing one location
loc = "Graz"
result = data.loc[loc]
result = data.loc[loc, "2021-09-06 06:15:00"]
#### Indexing multiple locations
loc = ["Graz", "Vienna"]
result = data.loc[loc]
#### Indexing one location with datetime condition
loc = "Graz"
mask = data.loc[loc].index.get_level_values(0) > np.datetime64('2021-09-06T06:15:00')
mask = data.loc[loc].index.get_level_values(0).hour == 8
result = data.loc[loc][mask]
#### Indexing multiple locations with datetime condition
loc = ["Graz", "Vienna"]
mask = data.loc[loc].index.get_level_values(1) > np.datetime64('2021-09-06 06:15:00')
mask = data.loc[loc].index.get_level_values(1).hour == 8
result = data.loc[loc][mask]
forecast.collectData(varList = variables, cores = None)
Spyder IDE <https://www.spyder-ide.org/>
_ does not produce print outputs if multiprocessing is enabled.Manuel Strohmaier
Licensed under the MIT license. See LICENSE <https://github.com/panodata/dwdGrib2location/blob/master/LICENSE>
_ for details.
The DWD has information about their terms of use policy in
German <https://www.dwd.de/DE/service/copyright/copyright_node.html>
_
and
English <https://www.dwd.de/EN/service/copyright/copyright_node.html>
_.
FAQs
API for DWD's open weather grib data.
We found that dwdGribExtractor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.