Skip to main content

wikixml

A Python Library to process wiki dumps xml.

Install

pip install wikixml --upgrade

Download Wiki Dumps

Visit: https://dumps.wikimedia.org/zhwiki/latest/

Download the latest wiki dump file with proxy:

curl -L --proxy http://127.0.0.1:11111 -o ~/repos/wikixml/data/zhwiki-latest-pages-meta-current.xml.bz2 https://dumps.wikimedia.org/zhwiki/latest/zhwiki-latest-pages-meta-current.xml.bz2

WikiXmlParser

Run example:

python example.py

See: example.py

from wikixml import WikiXmlParser

if __name__ == "__main__":
    wiki_xml_bz2 = "zhwiki-20241101-pages-meta-current.xml.bz2"
    file_path = Path(__file__).parent / "data" / wiki_xml_bz2
    parser = WikiXmlParser(file_path)
    # parser.preview_lines(5000)
    parser.preview_pages(max_pages=100)

WikiPagesMongoWriter

Extract wiki pages from XML and write to MongoDB

python -m wikixml.mongo -d zhwiki -f "../data/zhwiki-latest-pages-meta-current.xml.bz2"

Metadata

Release files for wikixml 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wikixml 0.3
File Size Uploaded Provenance Actions
wikixml-0.3.tar.gz 5.7 kB Without provenance Details for wikixml-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wikixml 0.3
File Interpreter ABI Platform Actions
wikixml-0.3-py3-none-any.whl Python 3 none any Details for wikixml-0.3-py3-none-any.whl

Total release size: 12.2 kB

Release files / wikixml-0.3.tar.gz

Download URL wikixml-0.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d4dd520f182f8c0aa5899e9ba36542a0d5295d67e1ce6e4558c5982b8bac5da
BLAKE2b-256 checksum
How to use checksums
7c21e6086df001c2cd163b110df503314d63e79d5d9fae25f76397d974de89e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Release files / wikixml-0.3-py3-none-any.whl

Download URL wikixml-0.3-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a44ecb6fe85a948a9af79caafb823f8940c6af56121d1e310558d42091b300a4
BLAKE2b-256 checksum
How to use checksums
83a006d281ef7d4b2e9d2320ca93ebf9bd981fd5579955265c1202d9c9102af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Security for wikixml 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page