MediaWiki Download Script
This is a very simple script to download the whole contents of MediaWiki instance via its API.
This script should not be used to download huge Wiki's as it will not scale well!
Features
- Downloading the content of all pages in their source-format
- Only downloading the latest revision (
rvlimit)
- Only downloading the latest revision (
- Optionally converting all source-files to Markdown-format (using
pandoc)
We did not yet have the need to also download the images. Feel free to open a PR!
Usage
Install:
pip install download-mediawiki
# or clone & run directly
python3 src/download_mediawiki/
Arguments:
download-mediawiki --help
> usage: MediaWiki Download Script (© OXL IT Services, License: MIT) [-h] -u URL [-o OUT_DIR] [-r]
> [-m]
>
> options:
> -h, --help show this help message and exit
> -u URL, --url URL Base-URL of the MediaWiki instance
> -o OUT_DIR, --out-dir OUT_DIR
> -r, --replace Replace/Update existing pages
> -m, --convert-to-md Convert all source-files to Markdown-format (pandoc executable
> required!)
Result
Overview: dump/overview.json
# namespace-id => page-id => page-title
cat dump/overview.json
> {
> "0": {
> "1": "Page Title"
> },
> "15": {}
> }
Files: dump//.mw
tree dump/
> dump/
> ├── 0
> │ ├── 1.mw
Content
head dump/0/1.mw
> # Main Page
> Welcome to the ''nftables'' HOWTO documentation page. Here you will find documentation on how to build, install, configure and use nftables.
>
> If you have any suggestion to improve it, please send your comments to Netfilter users mailing list <netfilter@vger.kernel.org>.
>
>
> = [[News]] =
>
>
> = Introduction =
Metadata
Release files for download-mediawiki 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| download_mediawiki-1.0.1.tar.gz | 6.3 kB | Without provenance | Details for download_mediawiki-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| download_mediawiki-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for download_mediawiki-1.0.1-py3-none-any.whl |
Total release size: 13.1 kB
Release files / download_mediawiki-1.0.1.tar.gz
| Download URL | download_mediawiki-1.0.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5203c4d31f00afa7ee58baae3968124e8cd830088e947aa01717e28a6c14d8d4
|
|
BLAKE2b-256 checksum How to use checksums |
90bd5115cf04adefa1b8af627e008c3b1821fcdccbd926467ea782e109ea3396
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / download_mediawiki-1.0.1-py3-none-any.whl
| Download URL | download_mediawiki-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02ad09afa1dcdc34631b1751a8a9d798c2004c04ea8150b5bae12d5df7c5386c
|
|
BLAKE2b-256 checksum How to use checksums |
a053b8b909151c3382c73d1b830eabc6aa80b46061e7510c5161ad5273ba560a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Security for download-mediawiki 1.0.1
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.