π 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.
geopy.adapters module. Previously all geocoders used urllib
π 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 -- uses requests libraryurllib). It is used by default if requests packagegeopy.adapters.URLLibAdapter -- uses urllib, basicallyrequests package is not installed.geopy.adapters.AioHTTPAdapter -- uses aiohttp library.β Added optional asyncio support in all geocoders via
π .AioHTTPAdapter, see the new Async Mode
doc section.
.AsyncRateLimiter -- an async counterpart of .RateLimiter.
.RateLimiter is now thread-safe.
β¬οΈ Dropped support for Python 2.7 and 3.4.
π New extras:
geopy[requests] for geopy.adapters.RequestsAdapter.geopy[aiohttp] for geopy.adapters.AioHTTPAdapter.geopy.distance algorithms now raise ValueError for points withgeopy.distance.vincenty, use geopy.distance.geodesic instead.timeout=None now disables request timeout, previouslyGoogleV3.timezone, use .GoogleV3.reverse_timezone instead.format_string param from all geocoders.Specifying Parameters Once doc section for alternatives.exactly_one's default is now True for all geocoders__init__ methodsgeocode/reverse.GoogleV3.reverse_timezone used to allow numeric at_time value.datetime instances instead.reverse methods used to bypass the query if it couldn't be parsed.Point. Now a ValueError is raised in this case..Location and .Timezone classes no longer accept Nonepoint and raw args..Nominatim now raises geopy.exc.ConfigurationError when.Point now raises a ValueError if constructed from a single number.None for authentication key arguments of.GeoNames, .OpenMapQuest and .Yandex.parse_* methods in geocoders have been prefixed with _.Nominatim has been moved from geopy.geocoders.osm modulegeopy.geocoders.nominatim. The old module is still present forπ 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.
geopy.adapters module. Previously all geocoders used urllib
π 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 -- uses requests libraryurllib). It is used by default if requests packagegeopy.adapters.URLLibAdapter -- uses urllib, basicallyrequests package is not installed.geopy.adapters.AioHTTPAdapter -- uses aiohttp library.β Added optional asyncio support in all geocoders via
π .AioHTTPAdapter, see the new Async Mode
doc section.
.AsyncRateLimiter -- an async counterpart of .RateLimiter.
.RateLimiter is now thread-safe.
β¬οΈ Dropped support for Python 2.7 and 3.4.
π New extras:
geopy[requests] for geopy.adapters.RequestsAdapter.geopy[aiohttp] for geopy.adapters.AioHTTPAdapter.geopy.distance algorithms now raise ValueError for points withgeopy.distance.vincenty, use geopy.distance.geodesic instead.timeout=None now disables request timeout, previouslyGoogleV3.timezone, use .GoogleV3.reverse_timezone instead.format_string param from all geocoders.Specifying Parameters Once doc section for alternatives.exactly_one's default is now True for all geocoders__init__ methodsgeocode/reverse.GoogleV3.reverse_timezone used to allow numeric at_time value.datetime instances instead.reverse methods used to bypass the query if it couldn't be parsed.Point. Now a ValueError is raised in this case..Location and .Timezone classes no longer accept Nonepoint and raw args..Nominatim now raises geopy.exc.ConfigurationError when.Point now raises a ValueError if constructed from a single number.None for authentication key arguments of.GeoNames, .OpenMapQuest and .Yandex.parse_* methods in geocoders have been prefixed with _