Skip to content
Tool to match strings to Wikidata items
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Command line utility to match strings to Wikidata items, written in Python 3


To match strings, first get a CSV file with QID's that you want to match (e.g., from the Wikidata Query Service) and get the metadata for all items import -i query.csv

If your CSV file has multiple columns and a header, you need to give it the key of the column where your qids are located as well import -i query.csv -k item --has-header

This will download all item data and write it to a JSON file, by default in a directory called data in the same folder as where you execute

To match your CSV file of strings try reconcile -i strings.csv -o strings-matched.csv

strings-matched.csv will contain the effort wdtool has made.


  • Before opening an issue, try running your command with the -v (verbose) switch, because this will give you more debug information.

All options

You'll get this output when running -h.

usage: [-h] [--has-header] -i INPUT [-k KEY] [-o OUTPUT]
                 [-dp DATA_PATH] [-v]

Tool to match strings to Wikidata items

positional arguments:

optional arguments:
  -h, --help            show this help message and exit
  --has-header          CSV file has a header
  -i INPUT, --input INPUT
                        Input CSV file
  -k KEY, --key KEY     If a CSV file has multiple columns, give the key of
                        the column
  -o OUTPUT, --output OUTPUT
                        Output CSV file
  -dp DATA_PATH, --data-path DATA_PATH
                        Path where the JSON Wikidata files will be saved,
                        defaults to /Users/hkrane01/htdocs/wdtool/data
  -v, --verbose         Display debug information


Licensed under the MIT license.


Written by Hay Kranen.

You can’t perform that action at this time.