Registry / data / geonames

geonames

JSON →
library0.1.3pypypi✓ verified 24d ago

This `geonames` library (version 0.1.3) is an older Python package primarily designed as a Command Line Interface (CLI) tool. It parses downloaded GeoNames.org geographical data dump files (typically `.txt` files) and converts them into clean OGR Shapefile or KML formats. The library's last update was in 2015, indicating it is no longer actively maintained.

pip install geonames
INSTALL
IMPORT
SIG · GEONAMES
G
geonames
datapythonv0.1.3
Install
2.5s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

geonames CLI tool
$ geonames PH.txt
import geonames # for parsing dumps to shapefile/KML
This specific `geonames` (0.1.3) package is primarily a command-line utility for converting GeoNames dump files to Shapefile/KML. It does not expose a direct Python API for this core functionality. Other packages, like `geonames-lib` or `geonamescache`, offer Python APIs and may use `import geonames`.

The primary use case for this `geonames` library is via its command-line interface to convert GeoNames dump files. Ensure you have downloaded a `.txt` dump file (e.g., `PH.txt` from `PH.zip`) before running the command. The `fiona` library and its GDAL/OGR dependencies must be installed for Shapefile/KML output to work.

# 1. Download a GeoNames dump file (e.g., for Philippines) # wget http://download.geonames.org/export/dump/PH.zip # unzip PH.zip # 2. Convert the downloaded .txt file to a Shapefile using the CLI tool geonames PH.txt # This will generate a Shapefile (e.g., PH.shp, PH.shx, PH.dbf, etc.) # in the current directory.
geonames --version
Debug
Known issues
breakingThe library is abandoned and was last updated in 2015. It may not be compatible with newer Python versions or depend on outdated versions of its dependencies (e.g., Fiona, GDAL) which could lead to installation or runtime issues.
fix
Consider using more actively maintained libraries like `fiona` directly for spatial data handling or `geopandas` for broader geospatial tasks, and parsing GeoNames data yourself or using libraries like `geonamescache` or `geonames-lib` that specifically handle GeoNames data in Python.
affects: <=0.1.3
gotchaName collision with other 'geonames' related packages: The PyPI package `geonames` (v0.1.3) is distinct from `geonames-lib` (a library for querying dumps), `geonamescache` (for in-memory cache), and `python-geonames` (an async database backend). Be careful to install and refer to the correct package.
fix
Always verify the PyPI project page (e.g., `pypi.org/project/geonames/`) and its documentation to ensure you are installing and using the intended library. For this specific `geonames` (0.1.3) package, its core functionality is exclusively via the `geonames` command-line tool, not `import geonames`.
affects: All versions
gotchaHeavy dependency on GDAL/OGR: This library relies on `fiona` for its core Shapefile/KML conversion, which in turn depends on the GDAL/OGR C++ library. Installing GDAL/OGR can be complex and platform-specific, often requiring system-level packages.
fix
Ensure that GDAL/OGR and its Python bindings (fiona) are correctly installed on your system before attempting to use the `geonames` CLI. Refer to the `fiona` installation documentation for detailed instructions specific to your operating system.
affects: All versions
Upgrade
Version history
0.1.3latest on PyPI · released Jul 29, 2015
Audit
Dependencies
fionarequiredRequired for reading/writing OGR vector data formats like Shapefile/KML, which is the core functionality of this library. Fiona itself depends on the GDAL/OGR C++ library.
Agent activity
9 hits · last 30 days
node
8
Resources
geonames — pip install geonames · libregistry