Command-line tool for the OpenCage Geocoding API
Project description
OpenCage CLI
A command-line tool for the OpenCage Geocoding API, for forward and reverse geocoding of CSV files.
Build Status / Code Quality / etc
Tutorial
See the CLI tutorial on the OpenCage site for a full walk-through.
Installation
Supports Python 3.9 or newer.
pip install opencage-cli
This installs an opencage executable on your PATH. The Python geocoding library it uses (the opencage package on PyPI) is pulled in as a dependency.
Usage
Use opencage forward or opencage reverse:
opencage forward --help
options:
-h, --help show this help message and exit
--api-key API_KEY Your OpenCage API key
--input FILENAME Input file name
--output FILENAME Output file name
--headers If the first row should be treated as a header row
--input-columns Comma-separated list of integers (default '1')
--add-columns Comma-separated list of output columns (default 'lat,lng,_type,_category,country_code,country,state,county,_normalized_city,postcode,road,house_number,confidence,formatted')
--workers Number of parallel geocoding requests (default 1)
--timeout Timeout in seconds (default 10)
--retries Number of retries (default 10)
--api-domain API domain (default api.opencagedata.com)
--optional-api-params
Extra parameters for each request (e.g. language=fr,no_dedupe=1)
--unordered Allow the output lines to be in different order (can be faster)
--limit Stop after this number of lines in the input
--dry-run Read the input file but no geocoding
--no-progress Display no progress bar
--quiet No progress bar and no messages
--overwrite Delete the output file first if it exists
--verbose Display debug information for each request
See examples/addresses.csv for sample input.
Working with AI / Agent Skill
There is an Agent Skill for working with the OpenCage Geocoding API.
Python library
If you want to call the OpenCage API directly from Python rather than via this CLI, install the opencage library — pip install opencage.
Copyright & License
This software is copyright OpenCage GmbH.
Please see LICENSE.txt
Who is OpenCage GmbH?
We run a worldwide geocoding API and geosearch service based on open data. Learn more about us.
We also run Geomob, a series of regular meetups for location based service creators, where we do our best to highlight geoinnovation. If you like geo stuff, you will probably enjoy the Geomob podcast.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencage_cli-1.0.0.tar.gz.
File metadata
- Download URL: opencage_cli-1.0.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50fc572137b2c075a835971ee9c8499514b178c8281c982e286fe70784c103f9
|
|
| MD5 |
d8c28f3c5272eee1e090d1463eec1b1b
|
|
| BLAKE2b-256 |
1d9cacfdb86f47346bfb24cff456e72cc687421fe0bc1cdd43a4904af2ba23f8
|
File details
Details for the file opencage_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: opencage_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1227c7c139f636060bf1d91fb00f7e19123a5b7fe9ea26213b62e0d0c62a7390
|
|
| MD5 |
d033e8c98229c9b6fda5ce1c249c85e2
|
|
| BLAKE2b-256 |
ed16d021c6d66902dce252414602ce1cb03e04edae9ddd664a82fa92b0f0bd0c
|