geopy v2.0.0 Release Notes
Release Date: 2020-06-27 // almost 6 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-Wdkey of thepythoncommand) and fixed
⬆️ all of them, then it should be safe to upgrade.🆕 New Features
geopy.adaptersmodule. 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-- usesrequestslibrary
👍 which supports keepalives (thus it is significantly more effective
📦 thanurllib). It is used by default ifrequestspackage
is installed.geopy.adapters.URLLibAdapter-- usesurllib, basically
0️⃣ it provides the same behavior as in geopy 1.x. It is used by default if
📦requestspackage is not installed.
-
geopy.adapters.AioHTTPAdapter-- usesaiohttplibrary.➕ Added optional asyncio support in all geocoders via
👀.AioHTTPAdapter, see the newAsync Mode
doc section..AsyncRateLimiter-- an async counterpart of.RateLimiter..RateLimiteris 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.distancealgorithms now raiseValueErrorfor points with
different altitudes, because altitude is ignored in calculations.- ✂ Removed
geopy.distance.vincenty, usegeopy.distance.geodesicinstead. - ⏱
timeout=Nonenow disables request timeout, previously
0️⃣ a default timeout has been used in this case. - ✂ Removed
GoogleV3.timezone, use.GoogleV3.reverse_timezoneinstead. - ✂ Removed
format_stringparam from all geocoders.
👀 SeeSpecifying Parameters Oncedoc section for alternatives. - 0️⃣
exactly_one's default is nowTruefor 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_timezoneused to allow numericat_timevalue.
Passdatetimeinstances instead.- 📜
reversemethods used to bypass the query if it couldn't be parsed
as a.Point. Now aValueErroris raised in this case. .Locationand.Timezoneclasses no longer accept None
forpointandrawargs.- 🔧
.Nominatimnow raisesgeopy.exc.ConfigurationErrorwhen
0️⃣ used with a default or sample user-agent. .Pointnow raises aValueErrorif 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
Nonefor authentication key arguments of
.GeoNames,.OpenMapQuestand.Yandex. - 🛠
parse_*methods in geocoders have been prefixed with_
to explicitly mark that they are private.
🗄 Deprecations
- 🚚
.Nominatimhas been moved fromgeopy.geocoders.osmmodule
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-Wdkey of thepythoncommand) and fixed
⬆️ all of them, then it should be safe to upgrade.🆕 New features
geopy.adaptersmodule. 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-- usesrequestslibrary
👍 which supports keepalives (thus it is significantly more effective
📦 thanurllib). It is used by default ifrequestspackage
is installed.geopy.adapters.URLLibAdapter-- usesurllib, basically
0️⃣ it provides the same behavior as in geopy 1.x. It is used by default if
📦requestspackage is not installed.
-
geopy.adapters.AioHTTPAdapter-- usesaiohttplibrary.➕ Added optional asyncio support in all geocoders via
👀.AioHTTPAdapter, see the newAsync Mode
doc section..AsyncRateLimiter-- an async counterpart of.RateLimiter..RateLimiteris 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.distancealgorithms now raiseValueErrorfor points with
different altitudes, because altitude is ignored in calculations.- ✂ Removed
geopy.distance.vincenty, usegeopy.distance.geodesicinstead. - ⏱
timeout=Nonenow disables request timeout, previously
0️⃣ a default timeout has been used in this case. - ✂ Removed
GoogleV3.timezone, use.GoogleV3.reverse_timezoneinstead. - ✂ Removed
format_stringparam from all geocoders.
👀 SeeSpecifying Parameters Oncedoc section for alternatives. - 0️⃣
exactly_one's default is nowTruefor 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_timezoneused to allow numericat_timevalue.
Passdatetimeinstances instead.- 📜
reversemethods used to bypass the query if it couldn't be parsed
as a.Point. Now aValueErroris raised in this case. .Locationand.Timezoneclasses no longer accept None
forpointandrawargs.- 🔧
.Nominatimnow raisesgeopy.exc.ConfigurationErrorwhen
0️⃣ used with a default or sample user-agent. .Pointnow raises aValueErrorif 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
Nonefor authentication key arguments of
.GeoNames,.OpenMapQuestand.Yandex. - 🛠
parse_*methods in geocoders have been prefixed with_
to explicitly mark that they are private.