https://github.com/edsu/wikidata_suggest
a CLI suggestion tool for Wikidata entities
https://github.com/edsu/wikidata_suggest
Last synced: about 1 year ago
JSON representation
a CLI suggestion tool for Wikidata entities
- Host: GitHub
- URL: https://github.com/edsu/wikidata_suggest
- Owner: edsu
- Created: 2015-05-19T18:12:26.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-09-24T00:36:56.000Z (over 9 years ago)
- Last Synced: 2025-02-25T11:39:27.048Z (over 1 year ago)
- Language: Python
- Size: 189 KB
- Stars: 29
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wikidata_suggest
[](http://travis-ci.org/edsu/wikidata_suggest)
`wikidata_suggest` is a simple command line tool for interactively reconciling
your data against [Wikidata](https://wikidata.org). First you'll want to
install:
% pip install wikidata_suggest
Once you've installed it you will get a command line tool `wd`:

Most likely you will want to use wikidata_suggest as a little data
cleansing/augmentation library. For example if you have a CSV spreadsheet
that has an *author* column that you'd like to link up to Wikidata, you
can do something like this:
```python
import csv
from wikidata_suggest import suggest
reader = csv.reader(open("data.csv"))
writer = csv.writer(open("new_data.csv", "wb"))
# read the csv
for row in reader:
# column 2 has author names
author = row[1]
# drop into interactive session
wikidata = suggest(author)
if wikidata:
row.append(wikidata["id"])
else:
row.append(None)
# write our new row
writer.writerow(row)
reader.close()
writer.close()
```