mwbase


Namemwbase JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/mediawiki-utilities/python-mwbase
SummaryData structure normalization for MediaWiki's Wikibase
upload_time2020-06-01 15:25:27
maintainer
docs_urlNone
authorAaron Halfaker
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # 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'])
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mediawiki-utilities/python-mwbase",
    "name": "mwbase",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Aaron Halfaker",
    "author_email": "aaron.halfaker@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4f/15/6ffc916ca6c4d60dc9fc2f64d3c4c7dc4f63faff3068770a192ed3e6c435/mwbase-0.1.5.tar.gz",
    "platform": "",
    "description": "# MediaWiki Wikibase\n\nThis package provides basic functionality for processing and normalizing\nWikidata Entity JSON.\n\n## Usage\n\n```python\n>>> import mwbase\n>>> import requests\n>>> \n>>> wb_doc = requests.get(\n...     \"https://wikidata.org/wiki/Special:EntityData/Q42.json\").json()\n>>> \n>>> entity = mwbase.Entity.from_json(wb_doc['entities']['Q42'])\n>>> \n>>> entity.labels['en']\n'Douglas Adams'\n>>> entity.properties.keys()\ndict_keys(['P1273', 'P1411', 'P269', 'P569', 'P950', 'P373', 'P140',\n'P2604', 'P2168', 'P2626', 'P3762', 'P244', 'P691', 'P2605', 'P1263',\n'P856', 'P108', 'P2019', 'P20', 'P69', 'P1559', 'P40', 'P1695', 'P18',\n'P119', 'P106', 'P1953', 'P735', 'P214', 'P26', 'P1442', 'P1303',\n'P2048', 'P1816', 'P509', 'P1670', 'P103', 'P349', 'P646', 'P2469',\n'P2387', 'P409', 'P800', 'P19', 'P2191', 'P21', 'P2188', 'P2163',\n'P910', 'P1477', 'P268', 'P3430', 'P3106', 'P434', 'P271', 'P22',\n'P1003', 'P1617', 'P551', 'P949', 'P1006', 'P1015', 'P2611', 'P1417',\n'P3373', 'P2963', 'P1207', 'P31', 'P866', 'P1266', 'P1233', 'P1258',\n'P1005', 'P1284', 'P1196', 'P906', 'P734', 'P25', 'P998', 'P227',\n'P947', 'P1315', 'P535', 'P3417', 'P648', 'P570', 'P172', 'P1415',\n'P1368', 'P2435', 'P27', 'P396', 'P1375', 'P1412', 'P345', 'P3222',\n'P213'])\n>>> entity.sitelinks.keys()\ndict_keys(['shwiki', 'eswikiquote', 'ruwikiquote', 'ruwiki',\n'itwikiquote', 'bewiki', 'mgwiki', 'hewikiquote', 'frwiki',\n'arzwiki', 'gawiki', 'cswikiquote', 'fawikiquote', 'huwikiquote',\n'elwiki', 'jvwiki', 'rowiki', 'etwiki', 'huwiki', 'ukwiki',\n'azwiki', 'trwiki', 'bgwikiquote', 'kowiki', 'euwiki', 'nlwikiquote',\n'mkwiki', 'plwiki', 'dawiki', 'dewiki', 'eowikiquote', 'svwiki',\n'zhwiki', 'cawiki', 'tawiki', 'idwiki', 'mlwiki', 'nnwiki', 'eswiki',\n'viwiki', 'frwikiquote', 'lawiki', 'bswiki', 'enwiki', 'scwiki',\n'enwikiquote', 'elwikiquote', 'fiwiki', 'mrwiki', 'fiwikiquote',\n'simplewiki', 'jawiki', 'scowiki', 'be_x_oldwiki', 'iswiki',\n'zhwikiquote', 'nowiki', 'etwikiquote', 'fawiki', 'arwiki',\n'plwikiquote', 'lvwiki', 'bnwiki', 'bgwiki', 'slwiki', 'cywiki',\n'iowiki', 'astwiki', 'kawiki', 'hewiki', 'barwiki', 'bswikiquote',\n'dewikiquote', 'ltwikiquote', 'vepwiki', 'hywikiquote', 'ocwiki',\n'mrjwiki', 'skwiki', 'ptwikiquote', 'ptwiki', 'glwikiquote',\n'liwikiquote', 'glwiki', 'warwiki', 'trwikiquote', 'srwiki',\n'azwikiquote', 'itwiki', 'thwikiquote', 'svwikiquote', 'hywiki',\n'eowiki', 'cswiki', 'sqwiki', 'urwiki', 'simplewikiquote',\n'skwikiquote', 'hrwiki', 'nlwiki'])\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Data structure normalization for MediaWiki's Wikibase",
    "version": "0.1.5",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "e7903d7d734beb63914e3b96515ce73a",
                "sha256": "9215644c8d38b08ecb4379fba3f620df71822ccf8aed0cd48b482a774baa9e0d"
            },
            "downloads": -1,
            "filename": "mwbase-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7903d7d734beb63914e3b96515ce73a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13710,
            "upload_time": "2020-06-01T15:25:17",
            "upload_time_iso_8601": "2020-06-01T15:25:17.294028Z",
            "url": "https://files.pythonhosted.org/packages/44/9d/3e4ddf62c3b08adddd6ae6f0b54128e1abf0a9cf105e077b03d62312c348/mwbase-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9296dd5ffd604f164a6e41dadcdc2b01",
                "sha256": "50b2f1ea4562ffe16c8faedcbe4ce71c19fe2798aa0ea235c52d2a8d0cc2d7c3"
            },
            "downloads": -1,
            "filename": "mwbase-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "9296dd5ffd604f164a6e41dadcdc2b01",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10375,
            "upload_time": "2020-06-01T15:25:27",
            "upload_time_iso_8601": "2020-06-01T15:25:27.970813Z",
            "url": "https://files.pythonhosted.org/packages/4f/15/6ffc916ca6c4d60dc9fc2f64d3c4c7dc4f63faff3068770a192ed3e6c435/mwbase-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-06-01 15:25:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "mediawiki-utilities",
    "github_project": "python-mwbase",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mwbase"
}
        
Elapsed time: 0.04321s