Skip to main content

Simple library for getting address or coordinates via Yandex geocoder

Project description

Yandex Geocoder

Get address coordinates via Yandex geocoder

test Coverage Status Code style: black Python versions PyPi

Installation

Synchronous version:

Install it via pip tool:

pip install yandex-geo

or Poetry:

poetry add yandex-geo

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


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.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yandex_geo-2.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file yandex_geo-2.1.2.tar.gz.

File metadata

  • Download URL: yandex_geo-2.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/23.3.0

File hashes

Hashes for yandex_geo-2.1.2.tar.gz
Algorithm Hash digest
SHA256 3654fd9678b44416629dec06c54a17603a62341eaff2cb454eeb9906af871e8e
MD5 ea481eb34e37dd1569802e7941351e79
BLAKE2b-256 968e607aaac28b4814fcc9d53f860655e86f7581e8b53e616834ba9f39c2f2a0

See more details on using hashes here.

File details

Details for the file yandex_geo-2.1.2-py3-none-any.whl.

File metadata

  • Download URL: yandex_geo-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/23.3.0

File hashes

Hashes for yandex_geo-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e35f67ae3dee1a3c75bf96da2ee7478b77d4329479920b680950b28e123463
MD5 ba2a6e9033ceeafc528f2d7645c9c78f
BLAKE2b-256 07d6916246092e03e220d079b1e4c6630f8c9d424349734bfcd80a4db9a9b327

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page