Skip to main content

An easy way to find a countries coordinates by name

Project description

pygeolocate

pip install pygeolocate

Get a country by its full name

# pygeolocate/examples/get_country_by_full_name.py
import pygeolocate

united_kingdom = pygeolocate.locate_by_name("united kingdom")[0]

print(country)
print(country.name)
print(country.coordinates)
print(country.coordinates[0])
print(country.coordinates['long'])

Get a country by part of its name

# pygeolocate/examples/get_country_by_partial_name.py

import pygeolocate

for country in pygeolocate.locate_by_name("united"):
    print(country)
    print(country.name)
    print(country.coordinates)
    print(country.coordinates[0])
    print(country.coordinates['long'])

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

pygeolocate-1.0.10.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

pygeolocate-1.0.10-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file pygeolocate-1.0.10.tar.gz.

File metadata

  • Download URL: pygeolocate-1.0.10.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for pygeolocate-1.0.10.tar.gz
Algorithm Hash digest
SHA256 b4861fa844ad0ce3f14e00bca20ad455d23e50f7d9f9b05a40971c6934cb9ad5
MD5 4d8b9f066e8ce22d92967a2b3aef94ba
BLAKE2b-256 9773a17aecd7b6202b61b1b450c3f705684a15388c5153f9e83b6921b837f56a

See more details on using hashes here.

File details

Details for the file pygeolocate-1.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for pygeolocate-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9f5556dcf087349d1addba495f570448bcdeba36c8a72d878d2c675bc699eab2
MD5 b1f7d2196916931c2fde5e3bec0460ee
BLAKE2b-256 53f1676a276ca9df95afe78ba7cc34ab171d233cd89abcca0562db5b895cf6a8

See more details on using hashes here.

Supported by

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