Skip to main content

Turn arbitary HTML content to mobile browser friendly format

Project description


mobile.htmlprocessing is a Python package providing utilities to sanitize arbitrary HTML content into mobile browser friendly format.

It is part of mFabrik Web and Mobile solutions package to build multichannel content management with Python.


  • Rewrite <img> tags so that images are resized for mobile viewing
  • Make arbitraty input HTML to valid XHTML to more compatible with mobile phones
  • Enforce empty ALT text on images missing ALT attribute
  • Protect against Cross-Site Scripting Attacks (XSS) and other nastiness, as provided by lxml.html.clean. Both trusted HTML and non-trusted HTML processing modes are supported.
  • Unicode compliant - eats funky characters

This is a framework library which is designed to work with any web server or Python based CMS system. It allow rewrites HTML. You need to subclass and specialize provided base classes to match with your CMS paradigms. For examples, see Go Mobile for Plone CMS add-on product.



Please see example code in unit tests.

Unit tests

Put mobile.htmlprocessing to your PYTHONPATH.

Run unit tests normally like:

python tests/

Commercial support and development

This package is licenced under open source GPL 2 license.

Commercial CMS and mobile development support options are available from mFabrik’s Web and Mobile product site.

Our top class Python developers are ready to help you with any software development needs.

0.9.2 - current

  • Don’t choke on empty HTML documents [miohtama]

0.9.1 - 0.9.2

  • Depend on lxml [miohtama]

0.9 - 0.9.1

  • Fixed maintainer information [miohtama]


  • Major project restructuring [miohtama]


  • Initial release

Project details

Download files

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

Files for mobile.htmlprocessing, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size (14.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page