https://github.com/recuencojones/pymeteo
Example Python XML retrieve and parse
https://github.com/recuencojones/pymeteo
aemet flask python xml-parsing
Last synced: 3 months ago
JSON representation
Example Python XML retrieve and parse
- Host: GitHub
- URL: https://github.com/recuencojones/pymeteo
- Owner: RecuencoJones
- Created: 2017-02-21T22:49:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-21T22:50:12.000Z (over 9 years ago)
- Last Synced: 2025-05-19T04:11:28.208Z (about 1 year ago)
- Topics: aemet, flask, python, xml-parsing
- Language: Python
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyMeteo
Simple Python example of retrieving and parsing XML data.
Uses a Flask server to expose endpoints from which to retrieve information.
## Requirements
- Python 2.7
## Installing
```
pip install -r requirements.txt
```
## Running
```
python server.py
```
The server will start on `http://localhost:5000`.
## Endpoints
### Weather
- Path: `/api/weather/`
- Parameters:
- id: int
An integer representing a municipality in Spain.
A full list of municipities can be found in this [Excel file](http://www.ine.es/daco/daco42/codmun/codmun09/09codmun.xls).
- Returns: string
- The name of the municipality of given id.
- An error message if the municipality id is not valid.
- Examples:
```
> http://localhost:5000/api/weather/50297
Name: Zaragoza Municipality ID: 50297
```