Skip to content

Commit 4006325

Browse files
Updated README and added LICENSE
1 parent 8e547d0 commit 4006325

File tree

2 files changed

+88
-24
lines changed

2 files changed

+88
-24
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2010-2014 Google, Inc. http://angularjs.org
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,90 @@
11
# _Datapoint for Python_
22

3-
_This is a Python module for accessing weather data via the [Met Office](http://www.metoffice.gov.uk/)'s open data API
3+
_A Python module for accessing weather data via the [Met Office](http://www.metoffice.gov.uk/)'s open data API
44
known as [Datapoint](http://www.metoffice.gov.uk/datapoint)._
55

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

11-
## Project Setup
11+
## Installation
1212

13-
_How do I, as a developer, start working on the project?_
13+
```Bash
14+
$ pip install datapoint
15+
```
1416

15-
1. _What dependencies does it have (where are they expressed) and how do I install them?_
16-
2. _How can I see the project working before I change anything?_
17+
You will also require a [Datapoint API key](http://www.metoffice.gov.uk/datapoint/API).
18+
## Example Usage
1719

18-
## Deploying
20+
```Python
21+
#!/usr/bin/env python
1922

20-
### _How to setup the deployment environment_
23+
import datapoint
2124

22-
- _Required heroku addons, packages, or chef recipes._
23-
- _Required environment variables or credentials not included in git._
24-
- _Monitoring services and logging._
25+
conn = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
2526

26-
### _How to deploy_
27+
site = conn.get_nearest_site(-0.124626, 51.500728)
28+
print site.name
2729

28-
## Troubleshooting & Useful Tools
30+
forecast = conn.get_forecast_for_site(site.id, "3hourly")
2931

30-
_Examples of common tasks_
32+
for day in forecast.days:
33+
print "\n%s" % day.date
34+
for timestep in day.timesteps:
35+
print timestep.name
36+
print timestep.weather.text
37+
print "%s%s%s" % (timestep.temperature.value,
38+
u'\xb0', #Unicode character for degree symbol
39+
timestep.temperature.units)
3140

32-
> e.g.
33-
>
34-
> - How to make curl requests while authenticated via oauth.
35-
> - How to monitor background jobs.
36-
> - How to run the app through a proxy.
41+
```
42+
43+
Example output
44+
```
45+
London
46+
47+
2014-07-16Z
48+
360
49+
Sunny day
50+
16°C
51+
540
52+
Sunny day
53+
22°C
54+
720
55+
Partly cloudy (day)
56+
24°C
57+
900
58+
Cloudy
59+
26°C
60+
1080
61+
Cloudy
62+
25°C
63+
1260
64+
Partly cloudy (night)
65+
23°C
66+
67+
...
68+
```
69+
70+
## Features
71+
* List forecast sites
72+
* Get nearest forecast site from lon and lat
73+
* Get the following 5 day forecast types for any site
74+
* Daily (Two timesteps, midday and midnight UTC)
75+
* 3 hourly (Eight timesteps, every 3 hours starting at midnight UTC)
76+
77+
### Future Enhancements
78+
* Observations for any site
79+
* Ensure correct typecasting on returned data
80+
* [Capabilities](http://www.metoffice.gov.uk/datapoint/product/uk-3hourly-site-specific-forecast/detailed-documentation#5,000 UK locations three hourly forecasts capabilities feed) (List available data without actually retrieving data)
81+
* Text forecasts
82+
* And more...
3783

3884
## Contributing changes
3985

40-
- _Internal git workflow_
41-
- _Pull request guidelines_
42-
- _Tracker project_
43-
- _Google group_
44-
- _irc channel_
45-
- _"Please open github issues"_
86+
Please feel free to submit issues and pull requests.
4687

4788
## License
89+
90+
[MIT Licence](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)