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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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