pyedxl - a python library for handling EDXL
I am proud to announce my latest work called which is a python library for handling OASIS Emergency Data Exchange Language (EDXL) Distribution Element. At this time, it partially supports most of specification version 1.0 published on March 14, 2006. The main purpose to develop this library is to learn how to use lxml effectively. For those who can't stand to read, you might directly go to the .
Currently, there is not official release yet. I recommend all you to try the latest code in the repository. Below is the checkout command.
svn checkout http://pyedxl.googlecode.com/svn/trunk/ pyedxl
I also includes an example how to use it in tests/
directory. Please don't expect too much. There is only one example by now. In summary, the example is named gdacs.py
that will convert fetched data from GDACS in RSS format to EDXL and print out the latest entry.
PYTHONPATH=. tests/gdacs.py
You may specify an e-mail as a command line argument to indicate sender ID.
PYTHONPATH=. tests/gdacs.py
In addition, you may specify the second argument as a local file or URL to override default RSS URL.
wget -O gdacs.xml http://www.gdacs.org/XML/RSS.xml
PYTHONPATH=. tests/gdacs.py gdacs.xml
See below for generated EDXL.
2006-12-16T14:20:34.308722
EN
Report
Actual
UNCLASSIFIED AND NOT SENSITIVE
asgard:476
1.220000,-77.170000,0.000000
-
Orange volcano alert: Galeras (Colombia) is Erupting
On Thursday, December 14, 2006, an activity change occurred in the volcano Galeras in Colombia. The volcano is Erupting with SWVRC alert level 3. Since this volcano is located in a region in which live about 1.5 million people in a 100 km area, the GDACS alert level is Orange.
http://www.gdacs.org/reports.asp?eventType=VO&system=asgard&ID=476&alertlevel=Orange&location=CO&glide_no=VO-2005-000193-COL
http://www.gdacs.org/ArchiveFolder/archiveVO.asp?eventType=VO&color=Orange&status=Erupting&search=Search+events
Thu, 14 Dec 2006 13:24 GMT+1
VO
Alert Level 3
Orange
VO_Orange
Erupting
476
Thu, 14 Dec 2006 13:24 GMT+1
Thu, 14 Dec 2006 13:24 GMT+1
Galeras
Erupting
956
3
-77.17
1.22
1587394
Colombia
VO-2005-000193-COL
Hopefully this work is useful for anyone who want to develop softwares related to EDXL and its friend. In fact, Python has many XML implementation and lxml is one of them. They are able to parse any XML and generate them back to string again. However, it is not easy to know which elements must be added where in the XML tree.
Note that this is just a result of learning lxml, please don't expect performance and scalability from the current code.
- sugree's blog
- 1747 reads
Recent comments
2 years 11 weeks ago
2 years 15 weeks ago
2 years 16 weeks ago
2 years 16 weeks ago
2 years 17 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 20 weeks ago