--- id: geotext version: "0.4.0" license: MIT license_treatment: permissive maintenance: abandoned --- # geotext — Geotext extracts countriy and city mentions from text License: permissive · Maintenance: abandoned · Downloads: 98.6K/mo ## What it is and what it does Geotext is a lightweight Python library that identifies and extracts country and city names from plain text. It parses input strings and returns structured results: a list of detected cities, a list of detected countries, and a frequency count of country mentions by ISO code. You can optionally filter results to cities within a specific country by passing a country code. The package relies on a built-in geographic database derived from geonames.org data and has no external runtime dependencies, making it fast and simple to integrate. It was last updated in 2018 and is no longer maintained; the repository is archived. While the core extraction logic remains functional, the underlying geographic data may not reflect recent city or country name changes, and compatibility with modern Python versions is untested. Use it for: - Extract city and country names from user-generated content, reviews, or social media posts for geographic analysis. - Filter travel or news articles by location mentions to organize content by region or country. - Preprocess text data for geospatial machine learning pipelines that require structured location labels. - Identify geographic scope in customer feedback or support tickets without external API calls. - Build lightweight location-aware search or tagging systems where offline extraction is preferred. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Geotext extracts mentions of countries and cities from unstructured text, returning them as structured data with optional filtering by country code. Yes, if you need simple, offline geographic entity extraction and can tolerate an unmaintained codebase. The lack of dependencies and low install friction make it attractive for lightweight projects. However, do not use it if you require current geographic data, active bug fixes, or support for modern Python versions—consider an actively maintained alternative for production systems. ## Install pip install geotext uv add geotext poetry add geotext ## Installing geotext Before you install: Installation is frictionless—the package has no runtime dependencies and ships as a pure Python wheel. However, the project is archived and abandoned; the last commit was in 2022 and no releases have occurred since 2018, so maintenance and bug fixes are not forthcoming. License in practice: MIT is a permissive license, so you may use, modify, and distribute geotext freely in commercial and private projects with minimal restrictions. The underlying geographic data is licensed under Creative Commons Attribution 3.0. Quickstart: pip install geotext from geotext import GeoText places = GeoText("London is a great city") print(places.cities) # ['London'] print(places.country_mentions) # OrderedDict([(u'GB', 1)]) Verify before relying: - Whether the geographic database (from geonames.org) is current enough for modern city and country name coverage. - Compatibility with Python versions beyond 3.6, given the package has not been updated since 2018. - Accuracy and recall of extraction on non-English text or transliterated place names. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 98.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags extract cities from text, country mention extraction, geographic entity recognition, city name detection, place name extraction, geotext parsing, location mention finder, nlp, geolocation, lightweight [View on SkillFed](https://skillfed.io/packages/geotext) · [View on PyPI](https://pypi.org/project/geotext/)