Skip to main content

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

Metadata

Release files for python-wikibase 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-wikibase 0.1.0
File Size Uploaded
python-wikibase-0.1.0.tar.gz 26.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-wikibase 0.1.0
File Interpreter ABI Platform
python_wikibase-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 128.3 kB

Release files / python-wikibase-0.1.0.tar.gz

Download URL python-wikibase-0.1.0.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4f13316aaad1101368fb5f480cc68de84bae8eb3ea4121d952d548d21c837abe
BLAKE2b-256 checksum
How to use checksums
d874dd2082d3ddc89dfe0d979c889be6ba1021f3d76f3c807c911ad4570c0bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.11 CPython/3.7.0 Darwin/18.6.0

Release files / python_wikibase-0.1.0-py3-none-any.whl

Download URL python_wikibase-0.1.0-py3-none-any.whl
Size 101.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f97407fc3ce9b9ec8641cba0c682a87b608c63d775706345d6c5d69864f42f90
BLAKE2b-256 checksum
How to use checksums
1613bddf50bdb2ee4fdc471fc7e081df8369cd82598a4080d142b9a4d3713629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.11 CPython/3.7.0 Darwin/18.6.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page