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
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.11.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for pygeolocate-1.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cbef5ea29d166e3f20de9544390172a2fec4e8740a1af32609b9282e9a23fd4 |
|
MD5 | 7871c52952e8e7839318138128010529 |
|
BLAKE2b-256 | ce628f3255d63083fd84d1f5b8d2dd6698e6ddb9bb6632c52bc0c1579f4f3b08 |