From 7291e26140a4333aa40d471556b707a807ff93a5 Mon Sep 17 00:00:00 2001 From: moanos Date: Fri, 31 May 2024 11:57:15 +0200 Subject: [PATCH] feat: Add management command to quickly test geocoding --- .../management/commands/query_location.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/fellchensammlung/management/commands/query_location.py diff --git a/src/fellchensammlung/management/commands/query_location.py b/src/fellchensammlung/management/commands/query_location.py new file mode 100644 index 0000000..c695fed --- /dev/null +++ b/src/fellchensammlung/management/commands/query_location.py @@ -0,0 +1,17 @@ +from django.core.management import BaseCommand +from fellchensammlung.tools.geo import GeoAPI + + +class Command(BaseCommand): + help = 'Query location data to debug' + + def add_arguments(self, parser): + # Named (optional) arguments + parser.add_argument( + "query", + help="The string to query", + ) + + def handle(self, *args, **options): + geo_api = GeoAPI(debug=False) + print(geo_api.get_location_from_string(options["query"]))