Skip to content

Commit

Permalink
All search results should include more info
Browse files Browse the repository at this point in the history
  • Loading branch information
Aareon Sullivan committed Oct 28, 2024
1 parent 71d7dbf commit f219bb7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions geonames/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,15 @@ def _format_detailed_result(geoname: Geoname) -> Dict[str, Any]:

def _format_search_result(geoname: Geoname) -> Dict[str, Any]:
"""
Format a Geoname object into a standardized search result dictionary.
Format a Geoname object into a standardized search result dictionary with detailed information.
Args:
geoname: The Geoname object to format
Returns:
Dictionary with standardized location fields
Dictionary with standardized location fields and additional details
"""
return {
"name": geoname.place_name, # Standardize on "name" for place name
"country": geoname.country_code, # Standardize on "country" for country code
"latitude": geoname.latitude,
"longitude": geoname.longitude,
}
return _format_detailed_result(geoname)


async def database_exists(engine: AsyncEngine) -> bool:
Expand Down

0 comments on commit f219bb7

Please sign in to comment.