🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

python-wikibase

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-wikibase

Wikibase queries and edits made easy

0.1.0
Maintainers
1

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts