Skip to main content

Data structure normalization for MediaWiki's Wikibase

Project description

# MediaWiki Wikibase

This package provides basic functionality for processing and normalizing Wikidata Entity JSON.

## Usage

`python >>> import mwbase >>> import requests >>> >>> wb_doc = requests.get( ... "https://wikidata.org/wiki/Special:EntityData/Q42.json").json() >>> >>> entity = mwbase.Entity.from_json(wb_doc['entities']['Q42']) >>> >>> entity.labels['en'] 'Douglas Adams' >>> entity.claims.keys() dict_keys(['P949', 'P21', 'P551', 'P1442', 'P69', 'P1368', 'P1303', 'P856', 'P2188', 'P434', 'P396', 'P509', 'P269', 'P1617', 'P1559', 'P2387', 'P1284', 'P734', 'P1695', 'P1375', 'P2435', 'P1266', 'P20', 'P1816', 'P950', 'P1411', 'P800', 'P31', 'P172', 'P906', 'P3106', 'P646', 'P570', 'P648', 'P2605', 'P866', 'P40', 'P271', 'P998', 'P1273', 'P103', 'P2963', 'P3430', 'P244', 'P2469', 'P2163', 'P2611', 'P2019', 'P910', 'P2626', 'P1005', 'P140', 'P569', 'P349', 'P1258', 'P25', 'P1412', 'P947', 'P18', 'P1207', 'P1015', 'P119', 'P214', 'P1670', 'P1003', 'P1233', 'P373', 'P2191', 'P26', 'P409', 'P1953', 'P22', 'P1006', 'P1477', 'P1263', 'P345', 'P535', 'P268', 'P691', 'P1196', 'P213', 'P27', 'P1417', 'P19', 'P735', 'P2168', 'P1315', 'P3373', 'P108', 'P3417', 'P227', 'P106', 'P2604', 'P1415', 'P3762']) >>> entity.sitelinks.keys() dict_keys(['cswiki', 'skwikiquote', 'elwiki', 'bgwiki', 'eowiki', 'simplewiki', 'trwikiquote', 'svwikiquote', 'idwiki', 'azwiki', 'etwikiquote', 'cswikiquote', 'gawiki', 'be_x_oldwiki', 'elwikiquote', 'itwikiquote', 'shwiki', 'ukwiki', 'skwiki', 'fawiki', 'arwiki', 'lvwiki', 'zhwikiquote', 'eswikiquote', 'fiwiki', 'mlwiki', 'mrwiki', 'dawiki', 'frwikiquote', 'bgwikiquote', 'plwikiquote', 'bswiki', 'warwiki', 'frwiki', 'cywiki', 'kawiki', 'hywikiquote', 'ocwiki', 'zhwiki', 'simplewikiquote', 'itwiki', 'lawiki', 'astwiki', 'dewikiquote', 'bnwiki', 'mgwiki', 'kowiki', 'plwiki', 'slwiki', 'huwikiquote', 'urwiki', 'hywiki', 'huwiki', 'sqwiki', 'nlwiki', 'trwiki', 'jvwiki', 'barwiki', 'iowiki', 'glwikiquote', 'thwikiquote', 'euwiki', 'hewikiquote', 'eowikiquote', 'eswiki', 'ltwikiquote', 'hrwiki', 'svwiki', 'cawiki', 'hewiki', 'viwiki', 'liwikiquote', 'tawiki', 'rowiki', 'bewiki', 'ruwiki', 'mkwiki', 'glwiki', 'mrjwiki', 'ruwikiquote', 'srwiki', 'fawikiquote', 'jawiki', 'fiwikiquote', 'bswikiquote', 'dewiki', 'nlwikiquote', 'scowiki', 'nowiki', 'iswiki', 'ptwikiquote', 'nnwiki', 'arzwiki', 'vepwiki', 'azwikiquote', 'ptwiki', 'enwiki', 'enwikiquote', 'etwiki']) `

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

mwbase-0.0.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

mwbase-0.0.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file mwbase-0.0.2.tar.gz.

File metadata

  • Download URL: mwbase-0.0.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mwbase-0.0.2.tar.gz
Algorithm Hash digest
SHA256 43e7d773c166cda9bf5db49a5c82d7a8e8bc207faebf3c466a1fa5900af725c1
MD5 b1b27f73c8a2b8b04c1eebd3e3c488a8
BLAKE2b-256 43b1309e15d7cfbb4d9c179c828a9bf3091bd240109e9d22d2de49b28d4449e1

See more details on using hashes here.

File details

Details for the file mwbase-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mwbase-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6bd5282295ff431424fbb5d594eba68a76cffbf161d18609854a1cc1075ea7e
MD5 9841d0f9562b32abdb7c42c87170431f
BLAKE2b-256 05a7fc7c5f13b2d6d7477e2b6500146a413d13321c3b92290616a9842e8f63e4

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