In Python ecosystem, there are few libraries for call calling geocoding web services. Sometimes, directly using raw Python instead can be faster.
GeoPy was the library for the job but we recently found a new project called
Geocoder and where wondering why it seems to do the same job. We didn't really found a clue but choose instead to compare both solutions.
Let's see how they differ.
Python version support:
GeoPy supports CPython 2.7, CPython 3.2, CPython 3.4, PyPy, and PyPy3 whereas
Geocoder supports "only" CPython 2.7 and 3.4.
Explanation: There is none on the
Explanation: Better because there are WKT and GeoJSON output whereas only in Nominatim in
Moreover, you can pipe results, combined with command line abilities.
Explanation: in fact, it's not really library dependend but it varies from each provider.
Explanation: It depends of the choosen/required geocoder(s)
There are 17 providers on
GeoPy and 18 providers on
Geocoder (included one nearly obsolete, TomTom)
We didn't inspect deeper the reverse-geocoding abilities but both are available.
You can see a summary below.
|Baidu Maps||Baidu Maps|
| ||IGN France|
|TomTom (dead so not useful anymore except for "old" TomTom clients e.g https://geocoder.tomtom.com|
On both side, you can find some advantages.
GeoPy, you can calculate distance between points using Haversine formula.
Geocoder, you get for free the GeoIP support using
MaxMind. You can determine your location from your IP or get an IP for a location. You can also manage Elevation with the
Google Elevation API and find Time Zone
Both libraries can use proxies or autocompletion on returned results (using
raw on GeoPy) when using IPython.
In our opinion,
GeoPy really focus on (reverse)geocoding only whereas
Geocoder is also about including more than the usual geocoding functions, in particular with the command line support.
We cannot choose a winner, both projects are too interesting.
Feel free to comment if any mistake was made on our side or you think some additions can be useful.
PS: Due to feedback, we updated supported geocoders list.