{"id":27046,"library":"htmlbuilder","title":"htmlBuilder","description":"A Python library for building HTML programmatically, providing a Pythonic way to construct HTML elements and attributes. The current stable version is 1.0.0, released on 2022-08-03. The project appears to be in maintenance mode with no recent updates.","status":"maintenance","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/jaimevp54/htmlBuilder","tags":["html","builder","templating","python","web"],"install":[{"cmd":"pip install htmlbuilder","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"tags is a module, not a top-level library","wrong":"import tags","symbol":"tags","correct":"from htmlbuilder import tags"},{"note":"attributes is a module, not a subpackage","wrong":"from htmlbuilder.attributes import attributes","symbol":"attributes","correct":"from htmlbuilder import attributes"},{"note":"html is a tag function inside the tags module","wrong":"from htmlbuilder import html","symbol":"html","correct":"from htmlbuilder.tags import html"}],"quickstart":{"code":"from htmlbuilder.tags import html, head, body, h1, p\nfrom htmlbuilder.attributes import Class, Id\n\ndoc = html(\n    head(),\n    body(\n        h1('Hello, world!', Class('main-title'), Id('title')),\n        p('This is a paragraph.', Class('content'))\n    )\n)\nprint(str(doc))","lang":"python","description":"Construct a simple HTML document with a heading and a paragraph."},"warnings":[{"fix":"Use str(node) or node.render() to produce the HTML output.","message":"All tag functions return a Node object, not a string. You must call str() or use render() to get the HTML string.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using an alternative like dominate or lxml.html if you need active maintenance.","message":"The library has not been updated since 2022 and may not support newer Python features or fix bugs.","severity":"deprecated","affected_versions":"1.0.0"},{"fix":"Use Class('value') or Id('value') from htmlbuilder.attributes for class and id.","message":"Attributes must be passed as keyword arguments or using attribute classes; positional attribute strings are not supported.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from htmlbuilder.tags import html'","cause":"Attempting to import html directly from the top-level package instead of from htmlbuilder.tags.","error":"ImportError: cannot import name 'html' from 'htmlbuilder'"},{"fix":"Ensure you import tag functions from htmlbuilder.tags and use them as html(...), not html(...).","cause":"Trying to call a Node object like a function, often due to forgetting to import the tag function correctly.","error":"TypeError: 'Node' object is not callable"},{"fix":"Node objects represent only the structure; use str() to get the HTML string. Do not attempt to modify after creation.","cause":"Trying to access an attribute or method that does not exist on a Node, often due to confusion with DOM manipulation.","error":"AttributeError: 'Node' object has no attribute '...'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}