Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install mwtemplates

How to install mwtemplates

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install mwtemplates
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.2 Available View build log
0.1 Available View build log
 
License
MIT
Dependencies
Depended by
Imports
Lastest release
version 0.2 on Sep 20th, 2013
https://travis-ci.org/danmichaelo/mwtemplates.png?branch=master https://coveralls.io/repos/danmichaelo/mwtemplates/badge.png

mwtemplates is a simple wikitext template parser and editor, based on a python rewrite of the mediawiki preprocessorDOM.php. Tested with python 2.6, 2.7, 3.2 and 3.3.

It can be installed directly off github:

System Message: ERROR/3 (<string>, line 13)

Unknown directive type "code-block".

.. code-block:: console

    $ pip install git+git://github.com/danmichaelo/mwtemplates.git

(There is also a version on PyPi that can be installed using pip install mwtemplates or easy_install mwtemplates)

Running tests

To run tests, clone the repo and do:

System Message: ERROR/3 (<string>, line 24)

Unknown directive type "code-block".

.. code-block:: console

    $ pip install -r requirements.txt
    $ pip install -r test_requirements.txt
    $ py.test -x tests --pep8 mwtemplates -v --cov mwtemplates --doctest-modules

Usage examples

Usage example:

System Message: ERROR/3 (<string>, line 35)

Unknown directive type "code-block".

.. code-block:: python

    from mwtemplates import TemplateEditor
    txt = u"""
    {{Infoboks geografi
    | kart = Svalbard_kart1.png
    | land = Norge
    | status = Øygruppe
    | administrasjon = [[Odd Olsen Ingerø]] ''<small>(2009)</small>''
    | administrasjonsnavn = [[Sysselmannen på Svalbard|Sysselmann]]
    | areal = 61022
    | befolkning = 2527
    | befolkningsår = [[2011]]
    | url = www.sysselmannen.svalbard.no
    }}
    """
    te = TemplateEditor(txt)
    te.templates['infoboks geografi'][0].parameters['land'] = 'Russland'
    print te.wikitext()

Subscribe to package updates

Last updated Sep 20th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.