An easy way to find a countries coordinates by name
Project description
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.8.tar.gz
(9.4 kB
view hashes)
Built Distribution
Close
Hashes for pygeolocate-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42f5f2b42382992330b91525ba31dc1fb342f1845db616ffd40ef3c76daf914c |
|
MD5 | 20b1d5e73a0efc7d839c8681ff3e29b1 |
|
BLAKE2b-256 | b766331e8db91824bdbdba40675481093c42ee086159860890d4d4ad9390be40 |