Socket
Book a DemoInstallSign in
Socket

pygeolocate

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pygeolocate

An easy way to find a countries coordinates by name

pipPyPI
Version
1.0.3
Maintainers
2

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'])

Keywords

location

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts