Python interface to the Met Office's Datapoint API
Project description
DataPoint for Python
A Python module for accessing weather data via the Met Office's open data API known as DataPoint.
Disclaimer: This module is in no way part of the DataPoint project/service. This module is intended to simplify the use of DataPoint for small Python projects (e.g school projects). No support for this module is provided by the Met Office and may break as the DataPoint service grows/evolves. The author will make reasonable efforts to keep it up to date and fully featured.
Features
- List forecast sites
- Get nearest forecast site from latitiude and longitude
- Get the following 5 day forecast types for any site
- Daily (Two timesteps, midday and midnight UTC)
- 3 hourly (Eight timesteps, every 3 hours starting at midnight UTC)
Installation
$ pip install DataPoint
You will also require a DataPoint API key.
For more installation methods see the installation guide.
Documentation
Detailed documentation for this project is available on Read the Docs. This project uses semantic versioning as defined at semver.org.
Example Usage
import datapoint
# Create connection to DataPoint with your API key
conn = datapoint.connection(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
# Get the nearest site for my latitude and longitude
site = conn.get_nearest_forecast_site(51.500728, -0.124626)
# Get a forecast for my nearest site with 3 hourly timesteps
forecast = conn.get_forecast_for_site(site.location_id, "3hourly")
# Get the current timestep from the forecast
current_timestep = forecast.now()
# Print out the site and current weather
print(site.name + "-" + current_timestep.weather.text)
Example output
London - Heavy rain
See examples directory for more in depth examples.
Contributing changes
Please feel free to submit issues and pull requests.
License
GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file datapoint-0.10.0.tar.gz
.
File metadata
- Download URL: datapoint-0.10.0.tar.gz
- Upload date:
- Size: 39.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9123deb3427d6e4bc0c14c57e68123a23d3b938747880abb03cbc062f8e6992a |
|
MD5 | 36225ada2ebd2a1f16a8afe85ebe63e7 |
|
BLAKE2b-256 | 5df931014bf040030e886e188c9b4426b3ad024fe6da12763cce22aca9657ffc |
Provenance
The following attestation bundles were made for datapoint-0.10.0.tar.gz
:
Publisher:
publish-to-pypi.yml
on EJEP/datapoint-python
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
datapoint-0.10.0.tar.gz
- Subject digest:
9123deb3427d6e4bc0c14c57e68123a23d3b938747880abb03cbc062f8e6992a
- Sigstore transparency entry: 149346913
- Sigstore integration time:
- Predicate type:
File details
Details for the file datapoint-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: datapoint-0.10.0-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d35fe39be4ee2d6afbfc1ff158966171ec77003c0e8d5fae12d597882458ae |
|
MD5 | 9fcdcd46a2677ca12a6b4899bd5d615c |
|
BLAKE2b-256 | 6767e18e81165146ef7dd902adbf3c41eb514825ad37ea513375186319cfce26 |
Provenance
The following attestation bundles were made for datapoint-0.10.0-py3-none-any.whl
:
Publisher:
publish-to-pypi.yml
on EJEP/datapoint-python
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
datapoint-0.10.0-py3-none-any.whl
- Subject digest:
e9d35fe39be4ee2d6afbfc1ff158966171ec77003c0e8d5fae12d597882458ae
- Sigstore transparency entry: 149346914
- Sigstore integration time:
- Predicate type: