Skip to main content
1 of 4

How to use ogrinfo in a python script

I've been using OGR/GDAL in its command window to obtain information regarding a vector file with this command

ogrinfo -so -al d:/vector_file.shp

I'm now trying to incorporate this in a python script but I'm unsure how to do it? I tried looking in this documentation https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#get-shapefile-feature-count

but couldn't find any examples with ogrinfo or how to explicitly state the arguments