Geoname Enrichment
This Python script reads placenames from CSV files and queries a custom API on top of geonames data to enrich the geoname identifier. The API and geonames database are available under Open Licenses at:
Usage via the command line
Create and activate a Python virtual environment
# Create a new Python virtual environment
python3 -m venv py-geo-env
# Activate the virtual environment
source py-geo-env/bin/activate
# Install dependencies
pip -r requirements.txt
# install the tool
pip install .
Available options
usage: geoname_enrichment.py [-h] -c CONFIG_FILE -p PLACENAME_COLUMN
--countryname-column COUNTRYNAME_COLUMN
--id-column ID_COLUMN -o OUTPUT_FILE
[-l LOG_FILE] [-L LOG_LEVEL]
inputFile
This script reads names of places, possibly in combination with countries, and
looks up the values in a local geonames-based API
positional arguments:
inputFile The input file containing CSV records
optional arguments:
-h, --help show this help message and exit
-c CONFIG_FILE, --config-file CONFIG_FILE
The config file with instructions how to enrich the
location data
-p PLACENAME_COLUMN, --placename-column PLACENAME_COLUMN
The name of the column in the input CSV that contains
the name of the place
--countryname-column COUNTRYNAME_COLUMN
The name of the column in the input CSV that contains
the country name
--id-column ID_COLUMN
The name of the column in the input CSV that contains
the row identifier
-o OUTPUT_FILE, --output-file OUTPUT_FILE
The output CSV file containing descriptive keys based
on the key composition config
-l LOG_FILE, --log-file LOG_FILE
The optional name of the logfile
-L LOG_LEVEL, --log-level LOG_LEVEL
The log level, default is INFO
Metadata
Release files for geoname-enrichment 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geoname_enrichment-0.1.0.tar.gz | 6.0 kB | Without provenance | Details for geoname_enrichment-0.1.0.tar.gz |
Release files / geoname_enrichment-0.1.0.tar.gz
| Download URL | geoname_enrichment-0.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2df60e2e5bfbb459a057b4e5a9a2f82aff46500a6ca8af1e5f31cfc7633236eb
|
|
BLAKE2b-256 checksum How to use checksums |
ab703140fe2d8699c73a28b55c8ea81645bdde22d66f98828d479539b51403db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.64.1 CPython/3.8.10
|
Security for geoname-enrichment 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.