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.6.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

mwbase-0.0.6-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mwbase-0.0.6.tar.gz
Algorithm Hash digest
SHA256 03198c77eb9cc85c158fae038fe18520ed2b146314560b9be1a85149b44c2680
MD5 f89209adf8bdef0b86ff84f48934fc28
BLAKE2b-256 bc9909707eb437e1d2a198e22e90720aec91259ee9d3c27ff83a8f3f96b9daf8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mwbase-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ad742e4a52db57f7404ff0ed0cda2fbe19e02b6bb78272ef990600940e464007
MD5 c22461e89f642559e3c9527d2879522b
BLAKE2b-256 5a0d358a1143843ee669f4cdd3bf8f0427fabea3e923c093737d1acbcf35e483

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