Skip to main content

Wikibase queries and edits made easy

Project description

python-wikibase

python-wikibase provides an object-oriented abstraction of the Wikibase API.

The library simplifies the authentication process and can be used to query and edit information on Wikidata or any other Wikibase instance.

Example

from python_wikibase import PyWikibase

# Authenticate with Wikibase
py_wb = PyWikibase(config_path="config.json")

# Fetch item and "coordinate location" property
item = py_wb.Item().get(entity_id="item label")
prop = py_wb.Property().get(entity_id="coordinate location")

# Create new GeoLocation value
value = py_wb.GeoLocation().create(1.23, 4.56)

# Create GeoLocation claim
claim = item.claims.add(prop, value)

Installation

pip install python-wikibase

Authentication

The PyWikibase class takes the same authentication and configuration parameters as the WikibaseApi class from the wikibase-api library. See its documentation for a guide on how to authenticate with Wikibase.

Usage

Documentation

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

python-wikibase-0.1.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

python_wikibase-0.1.0-py3-none-any.whl (101.8 kB view details)

Uploaded Python 3

File details

Details for the file python-wikibase-0.1.0.tar.gz.

File metadata

  • Download URL: python-wikibase-0.1.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.0 Darwin/18.6.0

File hashes

Hashes for python-wikibase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f13316aaad1101368fb5f480cc68de84bae8eb3ea4121d952d548d21c837abe
MD5 b38fbf022516cef03e6172cae0a25e03
BLAKE2b-256 d874dd2082d3ddc89dfe0d979c889be6ba1021f3d76f3c807c911ad4570c0bcb

See more details on using hashes here.

File details

Details for the file python_wikibase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_wikibase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 101.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.0 Darwin/18.6.0

File hashes

Hashes for python_wikibase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f97407fc3ce9b9ec8641cba0c682a87b608c63d775706345d6c5d69864f42f90
MD5 fb1dae91e044e0cb837f0ee6c92ec510
BLAKE2b-256 1613bddf50bdb2ee4fdc471fc7e081df8369cd82598a4080d142b9a4d3713629

See more details on using hashes here.

Supported by

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