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.7.tar.gz (5.9 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.7-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pywikidata-0.1.7.tar.gz
Algorithm Hash digest
SHA256 930baab425b7df47fd714c18c47b4f6a325436022e77f8842ec47e749763ec02
MD5 d4f699541c3ef1506d553c5af77f6fb0
BLAKE2b-256 120097f48bb1b5cd6b2cc1868079d7a8720e9ceb252f1074c6daca47993f4325

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pywikidata-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bc44271fc10e69a10b3b15bf7ec8a4ba0b1baf6070fbe6a9bdb863667130b835
MD5 b8afb2ccd1a932e2294a5fdc2a248cca
BLAKE2b-256 79c4eb614203e56c7d70572cd4f0a1669f9ea458bbd00b1275b67648963878c0

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