cogAdds ability to write scripts in Python in wiki pages
Developed by

XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager


This is a shortcut for Script Macro equivalent to {{script language="python"}} to execute python scripts based on any JSR-223 Python provider like Jython.


print "Hello World"

Parameters definition

See the Script Macro for details.


print "Hello World"


Hello World

External Libraries

External libraries can be used with XWiki by adding them to the proper classpath and importing them.

In order to determine what your classpath and pyclasspath locations are, use the following code:

import sys
print sys.path

Once you have the proper location, you can install your libraries through your normal means (pip, dnf, apt-get, etc), and copy the library to the classpath/pyclasspath locations respectively.  After installation, a restart is required to load the new library/libraries.


Though you can add additional libraries, there may be conflicts that you have to work through to be able to use that library with Xwiki.  An example is the 'boto' library, which conflicts due to function and class definitions that overlap.


Get Connected