Here's what I did
from pyrosm import OSM
# Initialize the OSM parser object
osm = OSM('/DATA/user/nabih/indonesia-latest.osm.pbf')
# Read all drivable roads
drive_net = osm.get_network(network_type="driving")
But it is memory error
Here's what I did
from pyrosm import OSM
# Initialize the OSM parser object
osm = OSM('/DATA/user/nabih/indonesia-latest.osm.pbf')
# Read all drivable roads
drive_net = osm.get_network(network_type="driving")
But it is memory error
https://osmcode.org/pyosmium/ provides a library to parse a osm.pbf. From what I remember, they keep the memory consumption to the minimum and provide different modes of parsing.
Checkout their documentation for basic usage tutorial and references.
The README of their GitHubprovides installation instructions.