geopy


Namegeopy JSON
Version 2.4.1 PyPI version JSON
download
home_pagehttps://github.com/geopy/geopy
SummaryPython Geocoding Toolbox
upload_time2023-11-23 21:49:32
maintainerKostya Esmukov
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords geocode geocoding gis geographical maps earth distance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            geopy
=====

.. image:: https://img.shields.io/pypi/v/geopy.svg?style=flat-square
    :target: https://pypi.python.org/pypi/geopy/
    :alt: Latest Version

.. image:: https://img.shields.io/github/actions/workflow/status/geopy/geopy/ci.yml?branch=master&style=flat-square
    :target: https://github.com/geopy/geopy/actions/workflows/ci.yml?query=branch%3Amaster
    :alt: Build Status

.. image:: https://img.shields.io/github/license/geopy/geopy.svg?style=flat-square
    :target: https://pypi.python.org/pypi/geopy/
    :alt: License


geopy is a Python client for several popular geocoding web
services.

geopy makes it easy for Python developers to locate the coordinates of
addresses, cities, countries, and landmarks across the globe using
third-party geocoders and other data sources.

geopy includes geocoder classes for the `OpenStreetMap Nominatim`_,
`Google Geocoding API (V3)`_, and many other geocoding services.
The full list is available on the `Geocoders doc section`_.
Geocoder classes are located in `geopy.geocoders`_.

.. _OpenStreetMap Nominatim: https://nominatim.org
.. _Google Geocoding API (V3): https://developers.google.com/maps/documentation/geocoding/
.. _Geocoders doc section: https://geopy.readthedocs.io/en/latest/#geocoders
.. _geopy.geocoders: https://github.com/geopy/geopy/tree/master/geopy/geocoders

geopy is tested against CPython (versions 3.7, 3.8, 3.9, 3.10, 3.11, 3.12)
and PyPy3. geopy 1.x line also supported CPython 2.7, 3.4 and PyPy2.

© geopy contributors 2006-2018 (see AUTHORS) under the `MIT
License <https://github.com/geopy/geopy/blob/master/LICENSE>`__.

Installation
------------

Install using `pip <http://www.pip-installer.org/en/latest/>`__ with:

::

    pip install geopy

Or, `download a wheel or source archive from
PyPI <https://pypi.python.org/pypi/geopy>`__.

Geocoding
---------

To geolocate a query to an address and coordinates:

.. code:: pycon

    >>> from geopy.geocoders import Nominatim
    >>> geolocator = Nominatim(user_agent="specify_your_app_name_here")
    >>> location = geolocator.geocode("175 5th Avenue NYC")
    >>> print(location.address)
    Flatiron Building, 175, 5th Avenue, Flatiron, New York, NYC, New York, ...
    >>> print((location.latitude, location.longitude))
    (40.7410861, -73.9896297241625)
    >>> print(location.raw)
    {'place_id': '9167009604', 'type': 'attraction', ...}

To find the address corresponding to a set of coordinates:

.. code:: pycon

    >>> from geopy.geocoders import Nominatim
    >>> geolocator = Nominatim(user_agent="specify_your_app_name_here")
    >>> location = geolocator.reverse("52.509669, 13.376294")
    >>> print(location.address)
    Potsdamer Platz, Mitte, Berlin, 10117, Deutschland, European Union
    >>> print((location.latitude, location.longitude))
    (52.5094982, 13.3765983)
    >>> print(location.raw)
    {'place_id': '654513', 'osm_type': 'node', ...}

Measuring Distance
------------------

Geopy can calculate geodesic distance between two points using the
`geodesic distance
<https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid>`_ or the
`great-circle distance
<https://en.wikipedia.org/wiki/Great-circle_distance>`_,
with a default of the geodesic distance available as the function
`geopy.distance.distance`.

Here's an example usage of the geodesic distance, taking pair
of :code:`(lat, lon)` tuples:

.. code:: pycon

    >>> from geopy.distance import geodesic
    >>> newport_ri = (41.49008, -71.312796)
    >>> cleveland_oh = (41.499498, -81.695391)
    >>> print(geodesic(newport_ri, cleveland_oh).miles)
    538.390445368

Using great-circle distance, also taking pair of :code:`(lat, lon)` tuples:

.. code:: pycon

    >>> from geopy.distance import great_circle
    >>> newport_ri = (41.49008, -71.312796)
    >>> cleveland_oh = (41.499498, -81.695391)
    >>> print(great_circle(newport_ri, cleveland_oh).miles)
    536.997990696

Documentation
-------------

More documentation and examples can be found at
`Read the Docs <http://geopy.readthedocs.io/en/latest/>`__.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/geopy/geopy",
    "name": "geopy",
    "maintainer": "Kostya Esmukov",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "kostya@esmukov.net",
    "keywords": "geocode,geocoding,gis,geographical,maps,earth,distance",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/0e/fd/ef6d53875ceab72c1fad22dbed5ec1ad04eb378c2251a6a8024bad890c3b/geopy-2.4.1.tar.gz",
    "platform": null,
    "description": "geopy\n=====\n\n.. image:: https://img.shields.io/pypi/v/geopy.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/geopy/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/github/actions/workflow/status/geopy/geopy/ci.yml?branch=master&style=flat-square\n    :target: https://github.com/geopy/geopy/actions/workflows/ci.yml?query=branch%3Amaster\n    :alt: Build Status\n\n.. image:: https://img.shields.io/github/license/geopy/geopy.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/geopy/\n    :alt: License\n\n\ngeopy is a Python client for several popular geocoding web\nservices.\n\ngeopy makes it easy for Python developers to locate the coordinates of\naddresses, cities, countries, and landmarks across the globe using\nthird-party geocoders and other data sources.\n\ngeopy includes geocoder classes for the `OpenStreetMap Nominatim`_,\n`Google Geocoding API (V3)`_, and many other geocoding services.\nThe full list is available on the `Geocoders doc section`_.\nGeocoder classes are located in `geopy.geocoders`_.\n\n.. _OpenStreetMap Nominatim: https://nominatim.org\n.. _Google Geocoding API (V3): https://developers.google.com/maps/documentation/geocoding/\n.. _Geocoders doc section: https://geopy.readthedocs.io/en/latest/#geocoders\n.. _geopy.geocoders: https://github.com/geopy/geopy/tree/master/geopy/geocoders\n\ngeopy is tested against CPython (versions 3.7, 3.8, 3.9, 3.10, 3.11, 3.12)\nand PyPy3. geopy 1.x line also supported CPython 2.7, 3.4 and PyPy2.\n\n\u00a9 geopy contributors 2006-2018 (see AUTHORS) under the `MIT\nLicense <https://github.com/geopy/geopy/blob/master/LICENSE>`__.\n\nInstallation\n------------\n\nInstall using `pip <http://www.pip-installer.org/en/latest/>`__ with:\n\n::\n\n    pip install geopy\n\nOr, `download a wheel or source archive from\nPyPI <https://pypi.python.org/pypi/geopy>`__.\n\nGeocoding\n---------\n\nTo geolocate a query to an address and coordinates:\n\n.. code:: pycon\n\n    >>> from geopy.geocoders import Nominatim\n    >>> geolocator = Nominatim(user_agent=\"specify_your_app_name_here\")\n    >>> location = geolocator.geocode(\"175 5th Avenue NYC\")\n    >>> print(location.address)\n    Flatiron Building, 175, 5th Avenue, Flatiron, New York, NYC, New York, ...\n    >>> print((location.latitude, location.longitude))\n    (40.7410861, -73.9896297241625)\n    >>> print(location.raw)\n    {'place_id': '9167009604', 'type': 'attraction', ...}\n\nTo find the address corresponding to a set of coordinates:\n\n.. code:: pycon\n\n    >>> from geopy.geocoders import Nominatim\n    >>> geolocator = Nominatim(user_agent=\"specify_your_app_name_here\")\n    >>> location = geolocator.reverse(\"52.509669, 13.376294\")\n    >>> print(location.address)\n    Potsdamer Platz, Mitte, Berlin, 10117, Deutschland, European Union\n    >>> print((location.latitude, location.longitude))\n    (52.5094982, 13.3765983)\n    >>> print(location.raw)\n    {'place_id': '654513', 'osm_type': 'node', ...}\n\nMeasuring Distance\n------------------\n\nGeopy can calculate geodesic distance between two points using the\n`geodesic distance\n<https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid>`_ or the\n`great-circle distance\n<https://en.wikipedia.org/wiki/Great-circle_distance>`_,\nwith a default of the geodesic distance available as the function\n`geopy.distance.distance`.\n\nHere's an example usage of the geodesic distance, taking pair\nof :code:`(lat, lon)` tuples:\n\n.. code:: pycon\n\n    >>> from geopy.distance import geodesic\n    >>> newport_ri = (41.49008, -71.312796)\n    >>> cleveland_oh = (41.499498, -81.695391)\n    >>> print(geodesic(newport_ri, cleveland_oh).miles)\n    538.390445368\n\nUsing great-circle distance, also taking pair of :code:`(lat, lon)` tuples:\n\n.. code:: pycon\n\n    >>> from geopy.distance import great_circle\n    >>> newport_ri = (41.49008, -71.312796)\n    >>> cleveland_oh = (41.499498, -81.695391)\n    >>> print(great_circle(newport_ri, cleveland_oh).miles)\n    536.997990696\n\nDocumentation\n-------------\n\nMore documentation and examples can be found at\n`Read the Docs <http://geopy.readthedocs.io/en/latest/>`__.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python Geocoding Toolbox",
    "version": "2.4.1",
    "project_urls": {
        "Download": "https://github.com/geopy/geopy/archive/2.4.1.tar.gz",
        "Homepage": "https://github.com/geopy/geopy"
    },
    "split_keywords": [
        "geocode",
        "geocoding",
        "gis",
        "geographical",
        "maps",
        "earth",
        "distance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e515cf2a69ade4b194aa524ac75112d5caac37414b20a3a03e6865dfe0bd1539",
                "md5": "ca3f24b601cffcbf405db5c4952fe475",
                "sha256": "ae8b4bc5c1131820f4d75fce9d4aaaca0c85189b3aa5d64c3dcaf5e3b7b882a7"
            },
            "downloads": -1,
            "filename": "geopy-2.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca3f24b601cffcbf405db5c4952fe475",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 125437,
            "upload_time": "2023-11-23T21:49:30",
            "upload_time_iso_8601": "2023-11-23T21:49:30.421025Z",
            "url": "https://files.pythonhosted.org/packages/e5/15/cf2a69ade4b194aa524ac75112d5caac37414b20a3a03e6865dfe0bd1539/geopy-2.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0efdef6d53875ceab72c1fad22dbed5ec1ad04eb378c2251a6a8024bad890c3b",
                "md5": "bf770e94c179ceffdb63df7a6ed67fe8",
                "sha256": "50283d8e7ad07d89be5cb027338c6365a32044df3ae2556ad3f52f4840b3d0d1"
            },
            "downloads": -1,
            "filename": "geopy-2.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bf770e94c179ceffdb63df7a6ed67fe8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 117625,
            "upload_time": "2023-11-23T21:49:32",
            "upload_time_iso_8601": "2023-11-23T21:49:32.734056Z",
            "url": "https://files.pythonhosted.org/packages/0e/fd/ef6d53875ceab72c1fad22dbed5ec1ad04eb378c2251a6a8024bad890c3b/geopy-2.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-23 21:49:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "geopy",
    "github_project": "geopy",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "geopy"
}
        
Elapsed time: 0.19267s