A parser for HTML templates.
Project description
HTML Template Parser
Modified version of Python's HTMLParser for HTML template parsing
🤔 For What?
The is an HTML template parser. It is a modified version of Python's HTMLParse library, expanded to handle template tags.
💾 Install
pip install html-template-parser
# or
poetry add html-template-parser
✨ How to Use
A basic usage example is remarkably similar to Python's HTMLParser:
from HtmlTemplateParser import Htp
class MyHTMLParser(Htp):
def handle_starttag(self, tag, attrs):
print("Encountered a start tag:", tag)
def handle_endtag(self, tag):
print("Encountered an end tag :", tag)
def handle_data(self, data):
print("Encountered some data :", data)
parser = MyHTMLParser()
parser.feed('<html><head><title>Test</title></head>'
'<body><h1>Parse me!</h1></body></html>')
🪪 License
- [GPL][license] © Riverside Healthcare
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 Distribution
html-template-parser-1.0.0.tar.gz
(22.2 kB
view hashes)
Built Distribution
Close
Hashes for html-template-parser-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dd6209a4318d773c8c651f8aeed685e0dc6bcd580ce90614f94fed303695c46 |
|
MD5 | 98da6b0127883f2a193f8e89501aba2c |
|
BLAKE2b-256 | 4eb6d6323e88eb85bf3065874fb0e022b2acbf98340413bae346fc447cc2d3c5 |
Close
Hashes for html_template_parser-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4880312239dd1611e9e6458aa15bec6b361c27c531d8936cadf7e6bc1a0db728 |
|
MD5 | 6bc7c563e027b151f1a7113611acf3aa |
|
BLAKE2b-256 | 9009b1ddd995dc5b975e82b3aac971cf391108117a511f6525b5c871cd002c53 |