{"id":24572,"library":"sec-parser","title":"sec-parser","description":"Parse SEC EDGAR HTML documents into a tree of elements that correspond to the visual structure of the document. Version 0.58.1, active development.","status":"active","version":"0.58.1","language":"python","source_language":"en","source_url":"https://github.com/alphanome-ai/sec-parser","tags":["sec","edgar","html","parsing","financial"],"install":[{"cmd":"pip install sec-parser","lang":"bash","label":"stable"}],"dependencies":[{"reason":"HTML parsing","package":"beautifulsoup4","optional":false},{"reason":"XML parser for BeautifulSoup","package":"lxml","optional":false}],"imports":[{"note":"Use underscore, not hyphen or missing separator","wrong":"from secparser import SECParser","symbol":"SECParser","correct":"from sec_parser import SECParser"},{"note":"SemanticElement is not at package root","wrong":"from sec_parser import SemanticElement","symbol":"SemanticElement","correct":"from sec_parser.semantic_elements import SemanticElement"}],"quickstart":{"code":"from sec_parser import SECParser\nfrom sec_parser.semantic_elements import TextElement\n\nhtml = \"<html><body><p>Revenue: $100</p></body></html>\"\nparser = SECParser()\ntree = parser.parse(html)\n# Print top-level elements\nfor element in tree:\n    if isinstance(element, TextElement):\n        print(element.text)","lang":"python","description":"Parse SEC EDGAR HTML into a tree of semantic elements, then iterate over them."},"warnings":[{"fix":"Use iteration over flat list instead of recursive traversal.","message":"In v0.50+, the output tree structure changed: flat list replaced nested tree. Code relying on parent-child traversal will break.","severity":"breaking","affected_versions":">=0.50.0"},{"fix":"Replace parse_html() with parse()","message":"SECParser.parse_html() removed in v0.40. Use SECParser.parse() instead.","severity":"deprecated","affected_versions":">=0.40.0"},{"fix":"Ensure HTML is from SEC EDGAR, not scraped with missing elements.","message":"Input HTML must be valid EDGAR document. Non-standard HTML may cause empty tree.","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":"Install via pip install sec-parser and import as from sec_parser import SECParser","cause":"Misspelled import or missing package.","error":"ModuleNotFoundError: No module named 'sec_parser'"},{"fix":"Use correct import: from sec_parser import SECParser","cause":"Importing directly from module rather than from sec_parser import SECParser.","error":"AttributeError: module 'sec_parser' has no attribute 'SECParser'"},{"fix":"Use parser.parse(html=...) instead of parser.parse(html_source=...)","cause":"Parameter name changed in v0.40 from html_source to html.","error":"TypeError: parse() got an unexpected keyword argument 'html_source'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}