Python utilities to reconcile Pandas DataFrames with Wikidata
Project description
reconciler
reconciler
is a python utility package to reconcile tabular data with Wikidata,
working similarly to what OpenRefine does, but entirely within Python, using Pandas.
Quickstart
You can install the latest version of reconciler from PyPI with:
pip install reconciler
Then to use it:
from reconciler import reconcile
import pandas as pd
# A DataFrame with a column you want to reconcile.
test_df = pd.DataFrame(
{
"City": ["Rio de Janeiro", "São Paulo", "São Paulo", "Natal"],
}
)
# Reconcile against type city (Q515), getting the best match for each item.
reconciled = reconcile(test_df["City"], qid_type="Q515")
The resulting dataframe would look like this:
id | match | name | score | type | type_qid | input_value |
---|---|---|---|---|---|---|
Q8678 | True | Rio de Janeiro | 100 | city | Q515 | Rio de Janeiro |
Q174 | True | São Paulo | 100 | city | Q515 | São Paulo |
Q131620 | True | Natal | 100 | municipality of Brazil | Q3184121 | Natal |
Check out the documentation for more advanced usage and to learn how to contribute.
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
reconciler-0.1.0.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for reconciler-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59bc71cedc1ca7940fcdfdcde482dcfedd329013a92df81fb6051a9293d17be3 |
|
MD5 | 66b5cdc6eb6170d4d5290f6fc8729fd2 |
|
BLAKE2b-256 | 0fb06620f45a459c5b7402f2651f3c0bd23995f905cfcadd0d72873656087b39 |