Registry / serialization / mwtypes

mwtypes

JSON →
library0.4.0pypypi✓ verified 84d ago

A set of types for processing MediaWiki data. Provides data structures for MediaWiki XML dumps, revisions, and page metadata. Latest version 0.4.0, low release cadence (last release 2019).

pip install mwtypes
INSTALL
IMPORT
SIG · MWTYPES
M
mwtypes
serializationpythonv0.4.0
Install
1.6s avg
Import
42ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.044s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.040s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Page
from mwtypes import Page
Standard import for Page type.
Revision
from mwtypes import Revision
Standard import for Revision type.

Basic usage creating a Page with a Revision.

from mwtypes import Page, Revision # Create a simple page object page = Page( id=123, title='Test Page', namespace=0, revisions=[Revision(id=1, text='Hello World')] ) print(page.title)
Debug
Known issues
gotchamwtypes is a low-level library; most users should use mwxml or mwcli for XML dump parsing.
fix
Use `mwxml` for iterating over dump files.
affects: all
gotchaFields may be None if not present; always check for None before accessing nested attributes.
fix
Always validate attributes like `page.namespace` before use.
affects: >=0.3.0
Errors
Common errors & fixes
ImportError: No module named 'mwtypes'
mwtypes not installed or environment issue.
fix
Run `pip install mwtypes`.
AttributeError: 'Page' object has no attribute 'revisions'
Revisions are stored under `page.revisions` but may be missing if page has no revisions.
fix
Check `page.revisions is not None` before accessing.
Upgrade
Version history
0.4.0latest on PyPI · released Jul 9, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mwtypes — pip install mwtypes · libregistry