OsProject

OsProject
id  py_ez_wikidata
state  active
owner  WolfgangFahl
title  py_ez_wikidata
url  https://github.com/WolfgangFahl/py_ez_wikidata
version  0.4.4
description  Mapping for Wikidata allows creation of wikidata entries from dicts
date  2026-08-31
since  2024-03-01
until  



Installation

pip install py-ez-wikidata
# alternatively if your pip is not a python3 pip
pip3 install py-ez-wikidata 
# local install from source directory of py-ez-wikidata 
pip install .

upgrade

pip install py-ez-wikidata  -U
# alternatively if your pip is not a python3 pip
pip3 install py-ez-wikidata -U


CLI (ezwd)

The ezwd command creates Wikidata items from a simple YAML/JSON record via a named property mapping. It is dry-run by default — add -w to write.

Search

ezwd -s "Robert David"

Inspect a mapping

ezwd -m scholar --list-mappings

Create from a record

Record robert_david.yaml:

label: Robert David
description: knowledge graph researcher
instanceof: Q5
orcid: "0000-0002-3244-5341"
dblp: "173/3493-1"
linkedInId: "robert-david-39b47692"
# dry-run (nothing written)
ezwd -m scholar -r robert_david.yaml
# write to production Wikidata
ezwd -m scholar -r robert_david.yaml -w

This created Q140424194 for Robert David (instance of human, ORCID, DBLP, LinkedIn). Only include an identifier once you have verified it belongs to this exact person — do not bulk-copy IDs from an author record that may aggregate homonyms.

Endpoint selection

ezwd -m scholar -r robert_david.yaml --test    # target test.wikidata.org
ezwd -m scholar -r robert_david.yaml --baseurl https://www.wikidata.org

Note: test.wikidata.org uses different property / item IDs than production, so a production-PID mapping (like scholar) will not validate there without a test-specific mapping.

Scholar mapping

The bundled scholar mapping (ez_wikidata/resources/scholar_props.yaml) covers the columns of Template:Scholar:

column property type
instanceof P31 (fixed value Q5) itemid
occupation P106 itemid
orcid P496 extid
dblp P2456 extid
gnd P227 extid
googleScholarUser P1960 extid
homepage P856 url
linkedInId P6634 extid
researchGate P2038 extid
shacl P12861 entity_schema

occupation is optional and has no default: an occupation is asserted only when the record states one.

Release 0.4.3

Mapping corrections, both found while creating a scholar item: