geopy v2.0.0 Release Notes
Release Date: 2020-06-27 // about 4 years ago-
๐ 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 thepython
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
0๏ธโฃ it provides the same behavior as in geopy 1.x. It is used by default if
๐ฆrequests
package is not installed.
-
geopy.adapters.AioHTTPAdapter
-- usesaiohttp
library.โ Added optional asyncio support in all geocoders via
๐.AioHTTPAdapter
, see the newAsync Mode
doc section..AsyncRateLimiter
-- an async counterpart of.RateLimiter
..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
0๏ธโฃ a default timeout has been used in this case. - โ Removed
GoogleV3.timezone
, use.GoogleV3.reverse_timezone
instead. - โ Removed
format_string
param from all geocoders.
๐ SeeSpecifying Parameters Once
doc section for alternatives. - 0๏ธโฃ
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 a.Point
. Now aValueError
is raised in this case. .Location
and.Timezone
classes no longer accept None
forpoint
andraw
args.- ๐ง
.Nominatim
now raisesgeopy.exc.ConfigurationError
when
0๏ธโฃ 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 of
.GeoNames
,.OpenMapQuest
and.Yandex
. - ๐
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.
Previous changes from v2.0.0.rc1
-
๐ 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 thepython
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
0๏ธโฃ it provides the same behavior as in geopy 1.x. It is used by default if
๐ฆrequests
package is not installed.
-
geopy.adapters.AioHTTPAdapter
-- usesaiohttp
library.โ Added optional asyncio support in all geocoders via
๐.AioHTTPAdapter
, see the newAsync Mode
doc section..AsyncRateLimiter
-- an async counterpart of.RateLimiter
..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
.
Chores
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
0๏ธโฃ a default timeout has been used in this case. - โ Removed
GoogleV3.timezone
, use.GoogleV3.reverse_timezone
instead. - โ Removed
format_string
param from all geocoders.
๐ SeeSpecifying Parameters Once
doc section for alternatives. - 0๏ธโฃ
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 a.Point
. Now aValueError
is raised in this case. .Location
and.Timezone
classes no longer accept None
forpoint
andraw
args.- ๐ง
.Nominatim
now raisesgeopy.exc.ConfigurationError
when
0๏ธโฃ 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 of
.GeoNames
,.OpenMapQuest
and.Yandex
. - ๐
parse_*
methods in geocoders have been prefixed with_
to explicitly mark that they are private.