Skip to main content

DataPoint for Python

PyPi version Supported Python versions Documentation Status

A Python module for accessing weather data via the Met Office's open data API known as DataPoint.

For personal reasons I have changed my GitHub username. The repository location has changed. The homepage link on PyPi is up-to-date

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

Metadata

Release files for datapoint 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datapoint 0.13.0
File Size Uploaded
datapoint-0.13.0.tar.gz 40.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datapoint 0.13.0
File Interpreter ABI Platform
datapoint-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.3 kB

Release files / datapoint-0.13.0.tar.gz

Download URL datapoint-0.13.0.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bb1b4998f4e21620715eb1e14da790050d0193e21c762f506acdee48f644dde9
BLAKE2b-256 checksum
How to use checksums
a00cdddf83eaefb63a08709d1ee0db02cebfbce092e1e8394c63ee0c28d786ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2025.

Transparency log

Release files / datapoint-0.13.0-py3-none-any.whl

Download URL datapoint-0.13.0-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae0caf457d55de6d9ab1957e0ce8e79f4d3e90404c2d72c9098233a0a096ecff
BLAKE2b-256 checksum
How to use checksums
bd9b771eee15a27cb62f575eacb179a9a955fe0d8a88f2839e6d1c1368ccf24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.9

2 release files

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page