Git Product home page Git Product logo

datapoint-python's Introduction

DataPoint for Python

PyPi version Supported Python versions Build Status Documentation Status

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

datapoint-python's People

Contributors

ejep avatar jacobtomlinson avatar rprudden avatar lgraham1 avatar dependabot-preview[bot] avatar alexhilson avatar deparkes avatar mrharcombe avatar pelson avatar alinelena avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.