> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# GeoPy

> GeoPy: A Python client for several popular geocoding web services. A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/geospatial/geopy/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/geospatial/geopy/geopy.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/geospatial/geopy.ipynb)

Description:
- A Python client for several popular geocoding web services.

Resources:
- [GitHub] https://github.com/geopy/geopy
- [Docs] https://geopy.readthedocs.io/en/latest/#geocoders

## Example 1

Synchronously geolocate a query to an address and coordinates

```python
from geopy.geocoders import Nominatim

geolocator = Nominatim(user_agent="demo-notebooks-geopy")
location = geolocator.geocode("175 5th Avenue NYC")

print(location.address)
print((location.latitude, location.longitude))
print(location.raw)
```

## Example 2

Asynchronously geolocate a query to an address and coordinates

```python
from geopy.adapters import AioHTTPAdapter
from geopy.geocoders import Nominatim
import asyncio


async def async_example():
    async with Nominatim(
        user_agent="demo-notebooks-geopy",
        adapter_factory=AioHTTPAdapter,
    ) as geolocator:
        location = await geolocator.geocode("175 5th Avenue NYC")
        print(location.address)

def main():
    loop = asyncio.get_event_loop()
    loop.run_until_complete(async_example())
    loop.close()

main()
```
