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 =
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 | |
|---|---|---|---|
| download_mediawiki-1.0.1.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| download_mediawiki-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
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
|