Commits

Dmitri Lebedev  committed 8956e5e

updated readme.md

  • Participants
  • Parent commits 27b2c87

Comments (0)

Files changed (1)

-Python OSM XML converter.
+osm2python : A  Simple Python OSM XML Converter
+===========
 
 Usage is extremely simple:
 
-    >>> from osm2py import load_osm
+    >>> from osm2python import load_osm, dump_osm
     >>> load_osm(open('my_file.osm'))
     [<a list of all the XML elements as dictionaries (see help(load_osm) for more info)>]
 
+Dump it back:
+
+    >>> dump_osm(open('another_file.osm', 'w'), new_doc_dictionary)
+
 If you want to save the elements into a custom storage, define a callback:
 
     >>> def cb(current, parent):
 
 You can also create an arbitrary filter for the elements:
 
-    >>> flt = lambda elt: (
-        elt['name'] == 'node' and
-        (54 < int(elt['attrs']['lat']) < 56)
-        and (82 < int(elt['attrs']['lon']) < 84)
+    >>> flt = lambda elt: (elt['name'] == 'node' and
+           (54 < int(elt['attrs']['lat']) < 56) and
+           (82 < int(elt['attrs']['lon']) < 84))
+
     >>> load_osm(open('my_file.osm'), element_filter=flt)
     <list of dictionaries>
 
+**tree.py** can import from OSM XML in Python objects representing the document and linking correctly one another.
+
 **osm_json.py** dumps these dictionaries in json format.
 
-**tree.py** can import from OSM XML in Python objects representing the document and linking correctly one another.
+Note: This project is not a PyPI package yet.