Extension:Piwo

The Piwo extension allows executing of Python scripts on MediaWiki (Python In, Wikitext Out).

The fork at https://github.com/WolfgangFahl/Piwo is an improvement using Manual:Shell_framework which allows for firejail settings. Pullrequest for the change is pending as of 2020-10-17.

Usage
This extension defines a custom namespace, "Gram", that stores Python scripts. Editing the Gram namespace requires the  right. To invoke a script, use the following parser function:

In the Python script, the parameters can be accessed through  (no import is needed); an extra function,   is provided as an equivalent to PHP's.

mw.py
Any and all of the Python standard library can be imported, as of January 2018. The accessiblity depends on the user you run your Mediawiki with.