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.10.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for pygeolocate-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f5556dcf087349d1addba495f570448bcdeba36c8a72d878d2c675bc699eab2 |
|
MD5 | b1f7d2196916931c2fde5e3bec0460ee |
|
BLAKE2b-256 | 53f1676a276ca9df95afe78ba7cc34ab171d233cd89abcca0562db5b895cf6a8 |