Spaces:
Sleeping
Sleeping
Commit
·
f5346bf
1
Parent(s):
7e78ae5
pydantic models
Browse files
models.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
""" Data models ffor the geotagging service"""
|
| 2 |
+
|
| 3 |
+
from typing import List
|
| 4 |
+
from pydantic import BaseModel
|
| 5 |
+
|
| 6 |
+
class GeoTagResult(BaseModel):
|
| 7 |
+
"""Defines the structure for a single geotag result."""
|
| 8 |
+
address: str
|
| 9 |
+
latitude: float
|
| 10 |
+
longitude: float
|
| 11 |
+
geotag: str
|
| 12 |
+
|
| 13 |
+
class GeoTagResponse(BaseModel):
|
| 14 |
+
"""Defines the structure for a successful API response."""
|
| 15 |
+
status: str = "success"
|
| 16 |
+
query: str
|
| 17 |
+
resolution: int
|
| 18 |
+
result: List[GeoTagResult]
|