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")
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
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
pygeolocate-1.0.9.tar.gz
(9.6 kB
view details)
Built Distribution
File details
Details for the file pygeolocate-1.0.9.tar.gz
.
File metadata
- Download URL: pygeolocate-1.0.9.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b79f2100402f735380e4416bb80dbdb316f354f242dc22f0f9438009190658f |
|
MD5 | ace8f7f7a6e5ff3a01044183edf26c87 |
|
BLAKE2b-256 | c9c5d7a8e47152e1a78b622df15fc4231c863cda5481837ae99246f5816a5efd |
File details
Details for the file pygeolocate-1.0.9-py3-none-any.whl
.
File metadata
- Download URL: pygeolocate-1.0.9-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed249c8a0777b4c59c1ed4b92e3a94115248ad6dc7fedf7e8a889e0c79bd8470 |
|
MD5 | 1450fc7d05a2fbcf52b47d9d8701715b |
|
BLAKE2b-256 | 627602806e988b5386aa4361792436d7575a19a7d393cef9c0f55aa84efc305f |