Jurk06 commited on
Commit
6f1ab54
1 Parent(s): 8dc3b30

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from geopy.geocoders import Nominatim
4
+ geolocator = Nominatim(user_agent="my-custom-user-agent")
5
+
6
+ def geocoding(address):
7
+ location = geolocator.geocode(address)
8
+ return location.latitude, location.longitude
9
+
10
+
11
+ # Create a Gradio interface
12
+ iface = gr.Interface(
13
+ fn=geocoding, # Specify your custom function
14
+ inputs="text", # Input type (text in this example)
15
+ outputs="text" # Output type (text in this example)
16
+ )
17
+
18
+ # Launch the Gradio interface
19
+ iface.launch()