punctuation is a Python tool that converts common punctuation markers in a string of text into proper HTML entities.
Source HTML entity Description
----------------------------------------------------------------------
--- — em dash
-- – en dash
"" ... "" “ and ” opening and closing double quotes
' ... ' ‘ and ’ opening and closing single quotes
' ’ apostrophe
Installation
Install with pip:
pip install punctuation
Or, the latest from Github:
pip install -e git+git://github.com/honza/punctuation.git#egg=punctuation
Usage
Command line utility:
punctuation path/to/file.html
Or, API:
from punctuation import HtmlPunctuationMaker
string = "This is a test---that's right"
html = HtmlPunctuationMaker(string).html
print html
>>>
"This is a test—that’s right"
Requirements:
- Python
Comments not found