Search for the Geonames IDs of city corrections, as well as verify current ROR assignments.
- Python 3.x
requests
librarycsv
modulethefuzz
library- Geonames user name
Ensure Python 3.x and pip are installed. Run:
pip install -r requirements.txt
python search_validate_geonames_corrections.py -i <input_csv> -o <output_csv> -u <geonames_user>
-i
/--input_csv
: Path to the input CSV file.-o
/--output_csv
: Path to the output CSV file.-u
/--geonames_user
: Geonames user name.
- Reads an input CSV file.
- Queries the ROR (Research Organization Registry) API for each row.
- Parse Geonames ID and city from ROR record
- Queries the Geonames API for city information.
- Outputs matched Geonames data to a specified CSV file.
The input CSV must contain the following headers:
ror_id
: ROR identifier.city_corrected
: Corrected city name.
The output CSV will contain the following additional headers:
ror_geonames_id
: Geonames ID from ROR query.ror_geonames_name
: Geonames city name from ROR query.city_corrected_geonames_id
: Geonames ID from direct query.city_corrected_geonames_name
: Geonames city name from direct query.