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 details)
Built Distribution
File details
Details for the file pygeolocate-1.0.11.tar.gz
.
File metadata
- Download URL: pygeolocate-1.0.11.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 | 0d8d0ff0d80d43ba482cefa7a68f0f4eebdf18d75fc7f953d2f4bfb3a46a1662 |
|
MD5 | 6f09df0066495f67868c0e711ecce167 |
|
BLAKE2b-256 | e8af8fa414fb2bce62fffa58d44dcbc96b15127e85c1d2f1339a142e7a75c469 |
File details
Details for the file pygeolocate-1.0.11-py3-none-any.whl
.
File metadata
- Download URL: pygeolocate-1.0.11-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 | 9cbef5ea29d166e3f20de9544390172a2fec4e8740a1af32609b9282e9a23fd4 |
|
MD5 | 7871c52952e8e7839318138128010529 |
|
BLAKE2b-256 | ce628f3255d63083fd84d1f5b8d2dd6698e6ddb9bb6632c52bc0c1579f4f3b08 |