It might be worth having a look at new readosm library https://www.gaia-gis.it/fossil/readosm/index