This might be a dumb question, but I wasn't able to find the answer anywhere.
Reading the metadata of a raster file in Python using GDAL is as easy as:
result = str(gdal.Info(raster.tif))
In this case I want to do the same for a shapefile. I know I can use
ogrinfo -ro -so -al foo.shp in the shell, but I have not found a way to do the same only in Python within a single line.
I'm looking for something like:
result = str(ogr.Info(shapefile.shp))
Am I missing something obvious or is there really no function like this?