This repository has been archived by the owner on Oct 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
72 lines (42 loc) · 1.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
As I was unable to establish contact with the author of https://gitorious.org/altut-i-python/pyyrlib, I created a copy here.
The file verda.txt is from http://om.yr.no/verdata/xml/.
TODO
----
* Sorting / searching in db has weird priorites. Ex: York gives jamaica/manchester/york. Resolve like this:
** Any request with several hits; list hits. no weather.
** Allow/requre user to specify: england/york or europe/york
Importing data into mysql
-------------------------
This is to enable name search (Norway and international).
* Create db with pyyrlib.sql
* Run 01-parse-data.sh
* Run 02-import-data.py
Copy of original README:
About
-----
This library provides a simple api for accessing weather data from the Norwegian web site yr.no. At the time being, it is extremely simple.
Example
-------
Import the module:
>>> import pyyrlib
Search for location:
>>> pyyrlib.get_location_url('location-name')
http://url-to-yr.no/xml-data-for-location-name.xml
Get weather data for the found location:
>>> pyyrlib.returnWeatherData('url-to-yr/location.xml')
{ weatherdata as dictionary }
Simple command line usage:
bash: pyyrlib.py 'url-ty-yr/location.xml'
[ acceptably formatted weatherdata in clean text ]
Known issues
------------
- Fragmented and sketchy
Todo
----
- Develop into a real python library
- Connect the search function and stedsnavn.txt
- https://github.com/wckd/python-yr look better. Check if it's feasible to migrate to it.
- Add proper hour-by-hour for foreign locations.
- Add days to printout so days can easily be distinguished [requested]
- Add warnings to bottom, i.e. flood warnings.
- Python3, general clean-up.