Simple library for getting address or coordinates via Yandex geocoder
Project description
Yandex Geocoder
Get address coordinates via Yandex geocoder
Installation
Synchronous version:
Install it via pip
tool:
pip install yandex-geocoder
or Poetry:
poetry add yandex-geocoder
Usage example
Yandex Geocoder requires an API developer key, you can get it here to use this library.
Synchronous version:
from decimal import Decimal
from yandex_geocoder import Client
client = Client("your-api-key")
coordinates = client.coordinates("Москва Льва Толстого 16")
assert coordinates == (Decimal("37.587093"), Decimal("55.733969"))
address = client.address(Decimal("37.587093"), Decimal("55.733969"))
assert address == "Россия, Москва, улица Льва Толстого, 16"
Asynchronous version:
import asyncio
from decimal import Decimal
from yandex_geocoder import Client
async def main():
aclient = Client(api_key="your-api-key")
coordinates = await aclient.aiocoordinates("Москва Льва Толстого 16")
assert coordinates == (Decimal("37.587093"), Decimal("55.733974"))
address = await aclient.aioaddress(Decimal("37.587093"), Decimal("55.733974"))
assert address == "Россия, Москва, улица Льва Толстого, 16"
if __name__ == '__main__':
asyncio.run(main())
Development and contribution
First of all you should install Poetry.
- install project dependencies
just install
- run linters
just lint
- run tests
just test
- feel free to contribute!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yandex_geo-2.1.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for yandex_geo-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be0a446316fea0043d21eb2d821a99cac36e903b9fec275d01c49088eaa70e0 |
|
MD5 | fa35b4ef1bda04bcca3262b9fd2e73fd |
|
BLAKE2b-256 | 5ed81217202dbaaa9b02f286e7018e05165810c3b416671883ec35eb83fe9354 |