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

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

Uploaded Source

Built Distributions

mwbase-0.1.3-py3.5.egg (30.7 kB view details)

Uploaded Source

mwbase-0.1.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mwbase-0.1.3.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.5

File hashes

Hashes for mwbase-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7f8da550bcedcd42e991979090c7f8dae1e3289c3cd1e30c614695629576a578
MD5 554d8c91e8fa31e6c89e2964247c4485
BLAKE2b-256 98d73ad4c9af8e7a045dd6c35ab4ddaf196e4b4153646c7250ffe7fad20f1e9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mwbase-0.1.3-py3.5.egg
  • Upload date:
  • Size: 30.7 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.1.3-py3.5.egg
Algorithm Hash digest
SHA256 3d1a1c1180c02b3e53d244cc1c802c7c64ffd8dfec68c1dd1fa34db0574931d0
MD5 815106d304885b96c22c488816491890
BLAKE2b-256 32bee798eef6f00f8a8ef4ed2a67780aaeab60bc107e5b03cc8783f9da267c86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mwbase-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.5

File hashes

Hashes for mwbase-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f3fc7ccd6926d49feca7ebb47a93a0e3053a4b15c064f95d4b04de60206b3011
MD5 7c286037e45460c4792212e9e987017d
BLAKE2b-256 e17e9424096394d016c54ee19dae5cbab58e2917dbf4fdb887f95e5ea91dc9ea

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