I'm looking for the correct method using GDAL (most recent trunk on Ubuntu) or its Python API to get the correct EPSG code for a given prj file WITHOUT relying on the prj2epsg webservice or any external webservice. To clarify, the solution needs to work on PRJ files that do NOT include the EPSG code within the definiton (which is, in my experience, nearly every shapefile out there) such as this one:
I'm connecting to these files using ogr_fdw in Postgres10/Postgis2.4. If there were some way to use ogr_fdw WITHOUT knowing the specific EPSG code for a given shapefile, I would accept that as an answer as well. I don't necessary need to know the source coordinate system -I'm just looking to transform to WGS84 when working with the data in postgis.