Simple way to convert numeric HTML entities to far more readable named entities.
Project description
Installation
pip install namedentities
(You may need to prefix this with “sudo “ to authorize installation.)
NOTA BENE Code runs successfully under Python 3, but packaging seemingly doesn’t work as yet.
Usage
Python 2:
from namedentities import named_entities u = u'both em\u2014and–dashes…' print named_entities(u)
Python 3:
from namedentities import named_entities u = 'both em\u2014and–dashes…' print(named_entities(u))
History
1.0.8 No longer attempts to encode <, >, or & (or thier numerical equivalents) to avoid interfering with HTML escaping.
This is basically a packaging of Ian Beck’s work (described in http://beckism.com/2009/03/named_entities_python/)
Thank you, Ian!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
namedentities-1.0.8.zip
(7.6 kB
view hashes)
namedentities-1.0.8.tar.gz
(3.3 kB
view hashes)