Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Remove the template markup from html files

Project Description

Template Remover

Template remover is a tool to remove the PHP and Jinja markup from HTML files.


Many tools, like html tidy, are designed to parse and analyze html files, however they do not play well when there is language markup. This projects aims to be a simple way of getting rid of those markups.


template_remover is based on regular expressions. This means that there are some edge cases that cannot be captured with this method. Although we believe those cases are too contrived, and probably should be avoided as many development tools will fail as well.

One example that won’t work is the following::

<?php echo "?>" ?>

The reason it does not work is because when the method sees the first ‘?>’ (the one inside the string), it thinks it’s a closing tag.

Example use

Below are example of how is used:

$ filename.html
$ filename.html | tidy -qe


You can install, upgrade or uninstall template-remover with these commands:

$ pip install template-remover
$ pip install --upgrade template-remover
$ pip uninstall template-remover

Python Versions

Python 2.7 is officially supported, 3.2, 3.3 and 3.4 should also work.


Help for this project is more than welcomed, so feel free to create an issue or to send a pull request via

Tests are run using nose, either with:

$ python -R nosetests
$ nosetests

Use the tool git-lint before any commit, so errors and style problems are caught early.

TODOS and Possible Features

  • Support more template engines and languages (Smarty, ASP, JSP, etc).


v0.1 (2014-05-07)

  • Initial commit.
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
template-remover-0.1.9.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Sep 29, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting