
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Generate HTML or XML in a pythonic way. Pure python alternative to web template engines. Based on BeautifulSoup parser. Can fill HTML forms with default values and error messages.
This library is based on the sources and definitions of yattag with the fondamental difference that BeautifulSoup is used as the html renderer.
*** At this time, only SimpleDoc has been converted, Doc class is work in progress. ***
( tutorial for both libraries: yattag.org_ and BS4_)
Nested html tags, no need to close tags, same as yattag.
.. code:: python
from bs4tag import Doc
doc, tag, text = Doc().tagtext()
with tag('html'):
with tag('body', id = 'hello'):
with tag('h1'):
text('Hello world!')
print(doc.getvalue())
Insert bs4tag document into a BeautifulSoup instance.
.. code:: python
def body_text():
doc, tag, text = SimpleDoc().tagtext()
with tag('h1'):
text('Hello world!')
return doc.soup
doc, tag, text = SimpleDoc().tagtext()
with tag('html'):
with tag('body', id='hello'):
pass
doc.soup.find(id='hello').append(body_text())
print(doc.getvalue())
# <html><body id="hello"><h1>Hello world!</h1></body></html>
pip3 install bs4tag
This library is compatible with the tutorial on yattag.org_
GitHub repo: https://github.com/ceprio/bs4tag Derived from: https://github.com/leforestier/yattag
.. _yattag.org: https://www.yattag.org .. _bs4: https://beautiful-soup-4.readthedocs.io/en/latest/
FAQs
Generate HTML or XML in a pythonic way. Pure python alternative to web template engines. Based on BeautifulSoup parser. Can fill HTML forms with default values and error messages.
We found that bs4tag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.