Wrapper for mwclient with improvements for 3rd party wikis
Project description
py-3rdparty-mediawiki (Wikipush Toolkit)
Python wrapper for mwclient with improvements for 3rd party wikis. Also known as the Wikipush Toolkit — a set of tools for automating MediaWiki page content handling using Python and a command line, presented at SMWCon Fall 2020. Works with any MediaWiki wiki: SMW wikis are queried natively; non-SMW wikis are supported by faking SMW-style queries for categories, enabling page pushing from wikis without Semantic MediaWiki installed.
Installation
pip install py-3rdparty-mediawiki
For MCP server support (for AI assistants):
pip install py-3rdparty-mediawiki[mcp]
Examples
wikipush
Copy pages between wikis:
wikipush -s smw -t test2 -q "[[Category:City]]|limit=5"
copying 4 pages from smw to test2
copying Demo:Tokyo ...✅
copying image File:SMW-Info-button.png ...✅
copying image File:Tokyo-Tsukishima-0011.jpg ...✅
copying Vienna ...✅
copying Warsaw ...✅
copying image File:6140285934 02e81b845f z.jpg ...✅
copying Demo:Würzburg ...✅
wikiupload
Upload files to a wiki:
wikiupload -t test --files car.png
uploading 1 files to test
1/1 ( 100%): uploading car.png ...✅
wikinuke
The default behavior is a dry run, listing whether the pages exist:
wikinuke -t test -p deleteMe1 deleteMe2 deleteMe3
deleting 3 pages in test (dry run)
1/3 ( 33%): deleting deleteMe1 ...👍
2/3 ( 67%): deleting deleteMe2 ...👍
3/3 ( 100%): deleting deleteMe3 ...👍
Use -f to force actual deletion:
wikinuke -t test -p deleteMe1 deleteMe2 deleteMe3 -f
deleting 3 pages in test (forced)
1/3 ( 33%): deleting deleteMe1 ...✅
2/3 ( 67%): deleting deleteMe2 ...✅
3/3 ( 100%): deleting deleteMe3 ...✅
wikiedit
Search and replace content in wiki pages:
wikiedit -t test -q "[[isA::CFP]]" --search "CALL FOR PAPER" --replace "CFP"
editing 1 pages in test (dry run)
1/1 ( 100%): editing CALL FOR PAPER Journal: Advances in Multimedia ... 👍
wikiuser
Configure wiki credentials interactively:
wikiuser
email: john@doe.com
scriptPath: /w
user: jd
url: http://www.semantic-mediawiki.org
version: Mediawiki 1.33
wikiId: smw
password: ****
shall i store jd smw? yes/no y/n
Links
- Python
- mwclient
- pyLoDStorage
- Wikipush Toolkit — SMWCon Fall 2020 talk
- SMWCon Fall 2020
- PyPI
- API Documentation
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_3rdparty_mediawiki-0.19.6.tar.gz.
File metadata
- Download URL: py_3rdparty_mediawiki-0.19.6.tar.gz
- Upload date:
- Size: 85.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a9b0bfe1571ce20e846a5b78ad2acef50a69e7c24bf74435d0953c693df8c81
|
|
| MD5 |
eadd12d054abec57fe31510e6a7ae198
|
|
| BLAKE2b-256 |
d93657dc5cafec927a02a9286271b5b575defd47d697ace5dc5215f030de7310
|
Provenance
The following attestation bundles were made for py_3rdparty_mediawiki-0.19.6.tar.gz:
Publisher:
upload-to-pypi.yml on WolfgangFahl/py-3rdparty-mediawiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_3rdparty_mediawiki-0.19.6.tar.gz -
Subject digest:
4a9b0bfe1571ce20e846a5b78ad2acef50a69e7c24bf74435d0953c693df8c81 - Sigstore transparency entry: 1998591325
- Sigstore integration time:
-
Permalink:
WolfgangFahl/py-3rdparty-mediawiki@e49d56503a3e3e9df84756da05a2a30d61d71085 -
Branch / Tag:
refs/tags/v0.19.6 - Owner: https://github.com/WolfgangFahl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@e49d56503a3e3e9df84756da05a2a30d61d71085 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py_3rdparty_mediawiki-0.19.6-py3-none-any.whl.
File metadata
- Download URL: py_3rdparty_mediawiki-0.19.6-py3-none-any.whl
- Upload date:
- Size: 59.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fb26785c656569667e10e53a0a0249e74174b04b3f0eee27d65cea489ca90ae
|
|
| MD5 |
b980cbd66095225e9f03535ea0c71ee9
|
|
| BLAKE2b-256 |
ad0e71e7ef3b08d81a66af27275b56bc10a6a42929ffed4d710a8cf278e60d1e
|
Provenance
The following attestation bundles were made for py_3rdparty_mediawiki-0.19.6-py3-none-any.whl:
Publisher:
upload-to-pypi.yml on WolfgangFahl/py-3rdparty-mediawiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_3rdparty_mediawiki-0.19.6-py3-none-any.whl -
Subject digest:
6fb26785c656569667e10e53a0a0249e74174b04b3f0eee27d65cea489ca90ae - Sigstore transparency entry: 1998591421
- Sigstore integration time:
-
Permalink:
WolfgangFahl/py-3rdparty-mediawiki@e49d56503a3e3e9df84756da05a2a30d61d71085 -
Branch / Tag:
refs/tags/v0.19.6 - Owner: https://github.com/WolfgangFahl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@e49d56503a3e3e9df84756da05a2a30d61d71085 -
Trigger Event:
release
-
Statement type: