--- id: soup2dict version: "2.1.0" license: MIT license_treatment: permissive maintenance: abandoned --- # soup2dict — Turns your beautifulsoup4 soup into python dictionary or json License: permissive · Maintenance: abandoned · Downloads: 97.1K/mo ## What it is and what it does soup2dict is a lightweight wrapper that transforms parsed HTML or XML into nested Python dictionaries. It preserves document structure by mapping element tags to dictionary keys, attributes to prefixed keys (e.g., '@href'), text content to '#text' keys, and child elements to lists. The output can be serialized directly to JSON. The package depends on beautifulsoup4 and classes. It targets Python 3.7 through 3.10 and is classified as Beta. Because the project has been abandoned since late 2021 with no maintenance activity, it will not receive updates for newer beautifulsoup4 releases or Python versions, and any bugs discovered will remain unfixed. Use it for: - Convert parsed HTML into JSON for REST API responses or data export pipelines. - Transform web-scraped HTML structures into dictionaries for downstream processing or storage. - Serialize XML documents parsed by beautifulsoup4 into nested dict format for configuration or data interchange. - Build data transformation workflows where HTML/XML input must be normalized to dict/JSON intermediate format. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts BeautifulSoup4 parsed HTML or XML objects into Python dictionaries or JSON, preserving element hierarchy, attributes, and text content. Yes, if you need a simple one-way HTML-to-dict converter and can tolerate an abandoned package. The code is stable (no known vulnerabilities, low install friction), but you will receive no updates if beautifulsoup4 introduces breaking changes or if you encounter edge-case bugs. Suitable for small scripts or legacy projects; avoid for new production systems where long-term maintenance is required. ## Install pip install soup2dict uv add soup2dict poetry add soup2dict ## Installing soup2dict Before you install: Low friction installation with a pure-Python wheel. The package is abandoned (last commit 2021-12-26) and has received no updates in over 1692 days, so expect no maintenance response to issues or compatibility problems with newer beautifulsoup4 versions. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the code provided you retain the license notice. Quickstart: pip install soup2dict from soup2dict import convert from beautifulsoup4 import BeautifulSoup soup = BeautifulSoup('

Hello

', 'html.parser') dict_result = convert(soup) Verify before relying: - Whether the package handles malformed HTML gracefully or what error modes occur with edge-case inputs. - Performance characteristics when converting large or deeply nested HTML structures. - Compatibility with beautifulsoup4 versions released after 2021-12-26. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 97.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags beautifulsoup to dict, html to dictionary conversion, soup to json, beautifulsoup4 serialization, parse html to dict, xml to python dict, html structure to json, html-parsing, data-transformation, serialization [View on SkillFed](https://skillfed.io/packages/soup2dict) · [View on PyPI](https://pypi.org/project/soup2dict/)