Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
metoffice-weather-datahub
Readme
Python wrapper around MetOffice Atmospheric Model Data REST API
MetOfficeDataHub is a simple wrapper for the API provided by the British Met Office known as Weather DataHub. It can be used to retrieve weather observations and forecasts. The aim is to focus on the AMD - Atmosphere Model Data REST API https://metoffice.apiconnect.ibmcloud.com/metoffice/production/product/17502/api/16908
This wrapper currently only downloads the latest results. No historic data can be fetched. The timestamp can be seen in the grib/xarray files.
⚠️ This (unofficial) library has been built and is maintained by Open Climate Fix, not the UK MetOffice.
You need to register with the Weather DataHub and obtain an API key and secret. These should be placed in environment variables
as API_KEY
and API_SECRET
.
Install directly from pypi using
pip install metoffice-weather-datahub
from metofficedatahub.multiple_files import MetOfficeDataHub
# 1. Get data from API, download grib files
datahub = MetOfficeDataHub(client_id="fake", client_secret="fake")
datahub.download_all_files(order_ids=["test_order_id"])
# 2. load grib files to one Xarray Dataset
data = datahub.load_all_files()
You can run the script directly as a CLI using:
python3 metofficedatahub/app.py --save-dir="s3://bucket/folder"
which will download all the files from Weather DataHub, join them together into a xarray dataset, and then save them.
You can set the environmental variable LOG_LEVEL
to define what log level you would like.
It may also be worth setting 'RAW_DIR' so that the raw files are saved to a certain folder, and not downloded again if they are already there.
The application can be run using docker
You can pull the production docker image from docker hub using
docker pull openclimatefix/metoffice_weather_datahub
You can also build your own docker image locally using
docker build -t metofficedatahub -f infrastructure/docker/Dockerfile .
and then to run the docker file use
docker run -it -e API_KEY=change -e API_SECRET=change -e SAVE_DIR='save_dir' -e ORDER_IDS='id1 id2 id3' metofficedatahub
When the data is loaded they are given a short name. Here is are some common examples:
Thanks goes to these wonderful people (emoji key):
Peter Dudfield 💻 | Flo 💻 | Jack Kelly 👀 | Jacob Bieker 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Python wrapper for the UK Met Office Weather DataHub API
We found that metoffice-weather-datahub 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.