Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relrod/pyunderground
Weather Underground Parser in Python
https://github.com/relrod/pyunderground
Last synced: 13 days ago
JSON representation
Weather Underground Parser in Python
- Host: GitHub
- URL: https://github.com/relrod/pyunderground
- Owner: relrod
- Created: 2010-02-06T02:15:44.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-02-07T04:37:58.000Z (over 14 years ago)
- Last Synced: 2024-10-10T18:10:58.753Z (26 days ago)
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
To use this class/module you need BeautifulSoup ('s BeautifulStoneSoup).
For debugging stuff, I use marcbelmont's python-print_r,
found here: http://github.com/marcbelmont/python-print_r
This makes things easier when dealing with embedded dicts like we are.The class should work something like this:
>>> import underground
>>> weather = underground.Forecast("New York, NY").RetrieveForecast(unicode=False)
>>> weather
{'low': {'fahrenheit': '18', 'celsius': '-8'}}>>> from print_r import print_r # (http://github.com/marcbelmont/python-print_r)
>>> print_r(weather)
low =
celsius = -8
fahrenheit = 18Note, this is a very new lib that I'm making for two purposes:
1) To make it easy to grab data to generate dynamic weather images
using PIL for a friend's project in TV Studio Class.
2) To learn BeautifulSoup better, because it's a great library,
I just don't know how to use it well yet.Because this library (PyUnderground) is so new, it doesn't do much yet.
As of the next commit, fahrenheit/celsius *low* temperatures should work,
for any number of days in a forecast, 1-6.