get_ogr_driver_from_filename

museotoolbox.processing.get_ogr_driver_from_filename(fileName)[source]

Return driver name used in OGR accoriding to the extension of the vector.

Parameters

fileName (str.) – Path of the vector with extension.

Returns

driverName – ‘SQLITE’, ‘GPKG’, ‘ESRI Shapefile’…

Return type

str

Examples

>>> mtb.processing.get_ogr_driver_from_filename('goVegan.gpkg')
'GPKG'
>>> mtb.processing.get_ogr_driver_from_filename('stopEatingAnimals.shp')
'ESRI Shapefile'