pyosm/parsing.py
def parse_osm_file(f, parse_timestamps=True):
    """Parse a file-like containing OSM XML into memory and return an object with
    the nodes, ways, and relations it contains. """

    nodes = []
    ways = []
    relations = []

    for p in iter_osm_file(f, parse_timestamps):

        if type(p) == model.Node:
            nodes.append(p)
        elif type(p) == model.Way:
            ways.append(p)
        elif type(p) == model.Relation:
            relations.append(p)

    return (nodes, ways, relations)
def parse_osm_file(f, parse_timestamps=True):
    nodes = []
    ways = []
    relations = []

    for p in iter_osm_file(f, parse_timestamps):

        if type(p) == model.Node:
            nodes.append(p)
        elif type(p) == model.Way:
            ways.append(p)
        elif type(p) == model.Relation:
            relations.append(p)

    return (nodes, ways, relations)
def parse_osm_file ( f , parse_timestamps = True ) : nodes = [ ] ways = [ ] relations = [ ] for p in iter_osm_file ( f , parse_timestamps ) : if type ( p ) == model . Node : nodes . append ( p ) elif type ( p ) == model . Way : ways . append ( p ) elif type ( p ) == model . Relation : relations . append ( p ) return ( nodes , ways , relations )
Parse a file-like containing OSM XML into memory and return an object with
    the nodes, ways, and relations it contains.
Parse a file - like containing OSM XML into memory and return an object with the nodes ways and relations it contains .