Changelog
2.4.1
2023-11-23
Bugfixes
2.4.0
2023-08-27
New Features
Breaking Changes
Removed Algolia Places geocoder: the service is shut down. Contributed by mtmail. (#547)
Packaging Changes
Bugfixes
Code Improvements
Move hardcoded domains to
__init__
args for all geocoders.
2.3.0
2022-11-13
New Features
MapBox
: addreferer
param to allow restricted api_keys. Contributed by Dennis Stritzke. (#501)MapBox
: addlanguage
param togeocode
. Contributed by Dennis Stritzke. (#503)Distance
: add floor division + right multiplication operators. (#485)GoogleV3
: pass the originalerror_message
to exceptions. (#398)
Packaging Changes
Drop support for Python 3.5 and 3.6.
Add support for Python 3.10 and 3.11.
Relax geographiclib upper version constraint to allow 2.x. Contributed by David Hotham. (#520)
Raise geographiclib lower version constraint to 1.52 to fix possible
ValueError
indistance.geodesic
due to the floating point inaccuracy. (#466)Move static metadata from
setup.py
tosetup.cfg
.
Deprecations
Bugfixes
Fix possible
TypeError
thrown byRequestsAdapter
on destruction. Contributed by Philip Kahn. (#488)ArcGIS
: get address from LongLabel if Address is empty.All geocoders: fix unexpected scientific point format for coordinates near zero in reverse geocoding. (#511)
BANFrance
: fix broken reverse (it looks like their API has changed in a backwards-incompatible way: thelng
query arg has been renamed tolon
).IGNFrance
: fix broken geocoder due to removal of authentication in their API. (#496)
Docs Improvements
Add url to the GIS Stack Exchange geopy tag. Contributed by Taras Dubrava. (#516).
GeocodeEarth
: add docs and pricing urls. Contributed by Julian Simioni. (#505).
2.2.0
2021-07-11
New Features
OpenCage
: addedannotations
param. Contributed by mtmail. (#464)Photon
: addedbbox
param. Contributed by Holger Bruch. (#472)New geocoder:
Geocodio
. Contributed by Jon Duckworth. (#468)New geocoder:
HereV7
. Contributed by Pratheek Rebala. (#433)New geocoder:
What3WordsV3
. Contributed by Saïd Tezel. (#444)New error class:
exc.GeocoderRateLimited
. This error extendsexc.GeocoderQuotaExceeded
and is now raised instead of it for HTTP 422 error code. (#479)AdapterHTTPError
: addedheaders
attribute. (#479)
Breaking Changes
Removed GeocodeFarm class: the service is very unstable. (#445)
Deprecations
Bugfixes
OpenCage
: improved error handling by using the default errors map (e.g. to raiseexc.GeocoderQuotaExceeded
instead ofexc.GeocoderQueryError
for HTTP 402 error). (#479)
Code Improvements
IGNFrance
: removed redundant check. Contributed by Miltos. (#469)Changed default exception type for HTTP code 408: now it is raised as
exc.GeocoderTimedOut
instead of a more genericexc.GeocoderServiceError
. (#479)geopy.exc
: extend more specific built-in exceptions where appropriate: classesConfigurationError
,GeocoderQueryError
,GeocoderNotFound
now extendValueError
;GeocoderRateLimited
andGeocoderUnavailable
extendIOError
;GeocoderTimedOut
extendsTimeoutError
. (#484)
Docs Improvements
Be more explicit in lat lon ordering. Contributed by Mateusz Konieczny. (#476)
Added tests for geocoders’ signatures (to ensure that all parameters are documented) and fixed docstrings which didn’t pass them. (#480)
Added docs for
Distance
class andDistance.destination()
method (#473)
2.1.0
2020-12-27
New Features
Breaking Changes
Bugfixes
Docs Improvements
Add Python 3.9 to the list of supported versions.
Bing
: changepostalcode
topostalCode
. Contributed by zhongjun-ma. (#424)Nominatim
: better describe what is returned in addressdetails. Contributed by Mateusz Konieczny. (#429)Nominatim
: better describeviewbox
param behavior. Contributed by Hannes. (#454)Yandex
: remove attention block about requiring an API key.
2.0.0
2020-06-27
geopy 2.0 is a major release with lots of cleanup and inner refactorings. The public interface of the library is mostly the same, and the set of supported geocoders didn’t change.
If you have checked your code on the latest 1.x release with enabled
warnings (i.e. with -Wd
key of the python
command) and fixed
all of them, then it should be safe to upgrade.
New Features
geopy.adapters
module. Previously all geocoders usedurllib
for HTTP requests, which doesn’t support keepalives. Adapters is a new mechanism which allows to use other HTTP client implementations.There are 3 implementations coming out of the box:
geopy.adapters.RequestsAdapter
– usesrequests
library which supports keepalives (thus it is significantly more effective thanurllib
). It is used by default ifrequests
package is installed.geopy.adapters.URLLibAdapter
– usesurllib
, basically it provides the same behavior as in geopy 1.x. It is used by default ifrequests
package is not installed.geopy.adapters.AioHTTPAdapter
– usesaiohttp
library.
Added optional asyncio support in all geocoders via
AioHTTPAdapter
, see the new Async Mode doc section.AsyncRateLimiter
– an async counterpart ofRateLimiter
.RateLimiter
is now thread-safe.
Packaging Changes
Dropped support for Python 2.7 and 3.4.
New extras:
geopy[requests]
forgeopy.adapters.RequestsAdapter
.geopy[aiohttp]
forgeopy.adapters.AioHTTPAdapter
.
Breaking Changes
geopy.distance
algorithms now raiseValueError
for points with different altitudes, because altitude is ignored in calculations.Removed
geopy.distance.vincenty
, usegeopy.distance.geodesic
instead.timeout=None
now disables request timeout, previously a default timeout has been used in this case.Removed
GoogleV3.timezone
, useGoogleV3.reverse_timezone()
instead.Removed
format_string
param from all geocoders. See Specifying Parameters Once doc section for alternatives.exactly_one
’s default is nowTrue
for all geocoders and methods.Removed service-specific request params from all
__init__
methods of geocoders. Pass them to the correspondinggeocode
/reverse
methods instead.All bounding box arguments now must be passed as a list of two Points. Previously some geocoders accepted unique formats like plain strings and lists of 4 coordinates – these values are not valid anymore.
GoogleV3.reverse_timezone()
used to allow numericat_time
value. Passdatetime
instances instead.reverse
methods used to bypass the query if it couldn’t be parsed as aPoint
. Now aValueError
is raised in this case.Location
andTimezone
classes no longer accept None forpoint
andraw
args.Nominatim
now raisesgeopy.exc.ConfigurationError
when used with a default or sample user-agent.Point
now raises aValueError
if constructed from a single number. A zero longitude must be explicitly passed to avoid the error.Most of the service-specific arguments of geocoders now must be passed as kwargs, positional arguments are not accepted.
Removed default value
None
for authentication key arguments ofGeoNames
,OpenMapQuest
andYandex
.parse_*
methods in geocoders have been prefixed with_
to explicitly mark that they are private.
Deprecations
Nominatim
has been moved fromgeopy.geocoders.osm
module togeopy.geocoders.nominatim
. The old module is still present for backwards compatibility, but it will be removed in geopy 3.