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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pywikidata-0.1.5.tar.gz
  • Upload date:
  • Size: 5.5 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.5.tar.gz
Algorithm Hash digest
SHA256 113c8eb22c6399fcb0143c08b50d48424f5baa653eed3644b1217651e7d173d1
MD5 4c489bc457c60826058d33ad01242bb1
BLAKE2b-256 192115bf7d84c57727dfaa77b56a5c6c3a1eb5522774179f397adb29fdaa6be3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pywikidata-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 96a56b1dcdbd5de50458fc42ae2cbd66bb97a15a40827e167142485d470e26ec
MD5 0ad00ada055d984c18ece6a6038fc696
BLAKE2b-256 3e577efde2a409c405786a89aaf3aebde9b461c7476cdf9f697d8919155b8378

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