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

Uploaded Source

Built Distributions

mwbase-0.0.5-py3.5.egg (24.6 kB view details)

Uploaded Source

mwbase-0.0.5-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mwbase-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9d8b90aaa284477daceea5dbb0df5013e8c0eab539e51f5a56d2172a096ce108
MD5 08b686dd64b2e22abe4cbd9f1992b40a
BLAKE2b-256 502aeb9498f195024afdb7fa127c91d5eaabf1311e5b5eb88faa372f4ba0d738

See more details on using hashes here.

File details

Details for the file mwbase-0.0.5-py3.5.egg.

File metadata

  • Download URL: mwbase-0.0.5-py3.5.egg
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.7.7

File hashes

Hashes for mwbase-0.0.5-py3.5.egg
Algorithm Hash digest
SHA256 47b5cc66cd12c7c414d6337fb08d5d757d9c8061c9a8a017cdf6f588e64257e6
MD5 830b12ebde70b292954ce9a16d92bad0
BLAKE2b-256 74632934dab2c2a2ff8f13c9ecf4d9681bbbca38cb0ef3683d31749bb0ffee4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mwbase-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0ab6e0922069251aebf4d890371f69d1a3d1e6a1ccdf8ffc30e520bca67f9b7a
MD5 6d4b53be641257307fec0fe7bc672e6b
BLAKE2b-256 3a2bbc003263efc0babd2bda988a375ab1551fd62b6d0061e90499e98c1b5f96

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