import geopandas as gpd from osgeo import ogr # Read file into GeoDataFrame data = gpd.read_file("my_shapefile.shp") # Pass the GeoDataFrame into ogr as GeoJson shp = ogr.Open(data.to_json()) # Do your stuff with ogr ...