Documentation, cleanup

This commit is contained in:
2024-01-17 20:53:18 +01:00
parent e1b464e36c
commit 17348f7acf
9 changed files with 165 additions and 75 deletions

View File

@@ -1,10 +1,17 @@
import urllib.request, json
class Location():
""" Class to handle location requests
"""
def __init__(self):
self.GEO_URL = "https://get.geojs.io/v1/ip/geo.json"
def run(self) -> dict:
def get_location(self) -> dict:
""" Request the location via network
Returns:
dict: latitude and longitude
"""
request = urllib.request.urlopen(self.GEO_URL)
data = json.load(request)