Skip to content

Instantly share code, notes, and snippets.

@bbelderbos
Last active June 5, 2025 14:10
Show Gist options
  • Select an option

  • Save bbelderbos/f1a27f3617c3ff16e72c6728675cec3d to your computer and use it in GitHub Desktop.

Select an option

Save bbelderbos/f1a27f3617c3ff16e72c6728675cec3d to your computer and use it in GitHub Desktop.

Revisions

  1. bbelderbos revised this gist Jun 5, 2025. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions find_location.py
    Original file line number Diff line number Diff line change
    @@ -8,3 +8,7 @@

    places = GeoText("I went from Paris to Berlin.")
    print(places.cities) # ['Paris', 'Berlin']

    # testing it seems city names do need to be capitalized!
    places = GeoText("How is the weather in Madrid today? And how about in Helsinki?")
    print(places.cities) # ['Madrid', 'Helsinki'] # helsinki is not recognized
  2. bbelderbos created this gist Jun 5, 2025.
    10 changes: 10 additions & 0 deletions find_location.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # /// script
    # dependencies = [
    # "geotext",
    # ]
    # ///

    from geotext import GeoText

    places = GeoText("I went from Paris to Berlin.")
    print(places.cities) # ['Paris', 'Berlin']