Skip to main content

Python Wrapper for Wikidata KG

Project description

pyWikiData

Python wrapper for Wikidata Knowledge Graph

Supported SPARQL backend

Install

pip install pywikidata

Install from source by poetry

poetry build

Usage

from pywikidata import Entity

entity = Entity('Q90')
entity.label # >> Paris

Entity.from_label('Paris') # >> [<Entity: Q116373885>, <Entity: Q116373939>, <Entity: Q90>, ...]

entity.instance_of # >> [<Entity: Q174844>, <Entity: Q200250>, <Entity: Q208511>, ...]

entity.forward_one_hop_neighbours # >> [(<Entity(Property): P6>, <Entity: Q2851133>), (<Entity(Property): P8138>, <Entity: Q108921672>), ...]
entity.backward_one_hop_neighbours

Entity("P81").is_property # >> True
Entity("Q90").is_property # >> False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywikidata-0.1.9.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywikidata-0.1.9-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pywikidata-0.1.9.tar.gz.

File metadata

  • Download URL: pywikidata-0.1.9.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.9 Darwin/23.1.0

File hashes

Hashes for pywikidata-0.1.9.tar.gz
Algorithm Hash digest
SHA256 b5e7152a24c2274fc0a68a2778098c3b7e2f623652fd9598f306cd7596a37e4b
MD5 4714d8782629ae7c4d0444a4f6e754a3
BLAKE2b-256 4b1be69068ee1d6b491afcbe0a25e919282e198ff3cc7afa4903488b8899533e

See more details on using hashes here.

File details

Details for the file pywikidata-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pywikidata-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.9 Darwin/23.1.0

File hashes

Hashes for pywikidata-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f9190910b62fa2d0942c79759438aeef9c43a004695601333e6f82e847eff4a8
MD5 82bd94291f3f9447dbdc2766e65e1e16
BLAKE2b-256 d17cf087d0adf8d5d774fb7d7bd38e976fcd7117b1373450edfded0e4a24be6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page