Skip to content

Commit 9376989

Browse files
Modified example and badges
1 parent 13eb3d6 commit 9376989

File tree

1 file changed

+24
-47
lines changed

1 file changed

+24
-47
lines changed

README.md

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,55 @@
1-
# _Datapoint for Python_
2-
[![PyPi version](https://pypip.in/v/datapoint/badge.svg?style=flat)](https://pypi.python.org/pypi/datapoint/)
3-
[![PyPi downloads](https://pypip.in/d/datapoint/badge.svg?style=flat)](https://pypi.python.org/pypi/datapoint/)
4-
[![Supported Python versions](https://pypip.in/py_versions/datapoint/badge.svg?style=flat)](https://pypi.python.org/pypi/datapoint/)
5-
[![Development Status](https://pypip.in/status/datapoint/badge.svg?style=flat)](https://pypi.python.org/pypi/datapoint/)
1+
# _DataPoint for Python_
2+
[![PyPi version](https://pypip.in/v/datapoint/badge.svg)](https://pypi.python.org/pypi/datapoint/)
3+
[![PyPi downloads](https://pypip.in/d/datapoint/badge.svg)](https://pypi.python.org/pypi/datapoint/)
4+
[![Supported Python versions](https://pypip.in/py_versions/datapoint/badge.svg)](https://pypi.python.org/pypi/datapoint/)
5+
[![Development Status](https://pypip.in/status/datapoint/badge.svg)](https://pypi.python.org/pypi/datapoint/)
66
[![Build Status](https://travis-ci.org/jacobtomlinson/datapoint-python.svg?branch=master)](https://travis-ci.org/jacobtomlinson/datapoint-python)
77

88

99
_A Python module for accessing weather data via the [Met Office](http://www.metoffice.gov.uk/)'s open data API
10-
known as [Datapoint](http://www.metoffice.gov.uk/datapoint)._
10+
known as [DataPoint](http://www.metoffice.gov.uk/datapoint)._
1111

12-
__Disclaimer: This module is in no way part of the datapoint project/service.
13-
This module is intended to simplify the use of Datapoint for small Python projects (e.g school projects).
14-
No support for this module is provided by the Met Office and may break as the Datapoint service grows/evolves.
12+
__Disclaimer: This module is in no way part of the DataPoint project/service.
13+
This module is intended to simplify the use of DataPoint for small Python projects (e.g school projects).
14+
No support for this module is provided by the Met Office and may break as the DataPoint service grows/evolves.
1515
The author will make reasonable efforts to keep it up to date and fully featured.__
1616

1717
## Installation
1818

1919
```Bash
20-
$ pip install datapoint
20+
$ pip install DataPoint
2121
```
2222

23-
You will also require a [Datapoint API key](http://www.metoffice.gov.uk/datapoint/API).
23+
You will also require a [DataPoint API key](http://www.metoffice.gov.uk/datapoint/API).
2424
## Example Usage
2525

2626
```Python
27-
#!/usr/bin/env python
28-
2927
import datapoint
3028

31-
conn = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
29+
# Create connection to DataPoint with your API key
30+
conn = datapoint.connection(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
3231

32+
# Get the nearest site for my longitude and latitude
3333
site = conn.get_nearest_site(-0.124626, 51.500728)
34-
print site.name
3534

35+
# Get a forecast for my nearest site with 3 hourly timesteps
3636
forecast = conn.get_forecast_for_site(site.id, "3hourly")
3737

38-
for day in forecast.days:
39-
print "\n%s" % day.date
40-
for timestep in day.timesteps:
41-
print timestep.name
42-
print timestep.weather.text
43-
print "%s%s%s" % (timestep.temperature.value,
44-
u'\xb0', #Unicode character for degree symbol
45-
timestep.temperature.units)
38+
# Get the current timestep from the forecast
39+
current_timestep = forecast.now()
40+
41+
# Print out the site and current weather
42+
print site.name, "-", current_timestep.weather.text
4643

4744
```
4845

4946
Example output
5047
```
51-
London
52-
53-
2014-07-16Z
54-
360
55-
Sunny day
56-
16°C
57-
540
58-
Sunny day
59-
22°C
60-
720
61-
Partly cloudy (day)
62-
24°C
63-
900
64-
Cloudy
65-
26°C
66-
1080
67-
Cloudy
68-
25°C
69-
1260
70-
Partly cloudy (night)
71-
23°C
72-
73-
...
48+
London - Heavy rain
7449
```
7550

51+
See [examples directory](https://github.com/jacobtomlinson/datapoint-python/tree/master/examples) for more in depth examples.
52+
7653
## Features
7754
* List forecast sites
7855
* Get nearest forecast site from longitude and latitiude
@@ -86,4 +63,4 @@ Please feel free to submit issues and pull requests.
8663

8764
## License
8865

89-
Currently under decision.
66+
Currently under decision.

0 commit comments

Comments
 (0)