stripogram

Strip-o-Gram HTML Conversion Library
Download

stripogram Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Chris Withers
  • Publisher web site:
  • https://secure.simplistix.co.uk/

stripogram Tags


stripogram Description

Strip-o-Gram HTML Conversion Library stripogram is a strip-o-gram HTML conversion library written in Python.This is a library for converting HTML to Plain Text and stripping specified tags from HTML.Installation for Python Simply copy the stripogram package to any folder on your PYTHONPATH.Alternatively, if you have distutils available to you, you can install by executing the following in the directory where you unpacked the tarball: python setup.py installInstallation for ZopeThe stripogram package can also be used as a Zope Product. To do this, place the package in your Zope Products directory and restart Zope. NB: When using Strip-o-Gram as a Zope Product, you must change any import statements that contain 'stripogram' to 'Products.stripogram'Usage: from stripogram import html2text, html2safehtml mylumpofdodgyhtml # a lump of dodgy html # Only allow < b >, < a >, < i >, < br >, and < p > tags mylumpofcoolcleancollectedhtml = html2safehtml(mylumpofdodgyhtml,valid_tags=('b', 'a', 'i', 'br', 'p')) # Don't process < img > tags, just strip them out. Use an indent of 4 spaces # and a page that's 80 characters wide. mylumpoftext = html2text(mylumpofcoolcleancollectedhtml,ignore_tags=('img',),indent_width=4,page_width=80)If you want more information on how it works, read the source. Requirements: · Python


stripogram Related Software