Skip to main content

HTML converter tool

Project description

HTML Converter Tool

Support Html to Dict, JSON, Str

Installing

Install and update using pip3:

$ pip3 install html_converter

Python 3 and newer.

Simple Usage

if __name__ == '__main__':
    import pprint
    from html_converter import HtmlToDict

    html_data = '<html><body>test text</body></html>'
    converter = HtmlToDict()
    data = converter.convert(html_data, serialize=False)

    pp = pprint.PrettyPrinter(indent=1)
    pp.pprint(converter.convert(html_data, serialize=False).to_dict())
    [{'attrs': {},
      'inner': [{'attrs': {}, 'inner': [], 'tag': 'body', 'text': 'test text'}],
      'tag': 'html',
      'text': ''}]

    print(converter.convert(html_data, serialize=False).to_json())
    '[{"tag": "html", "attrs": {}, "text": "", "inner": [{"tag": "body", "attrs": {}, "text": "fd", "inner": []}]}]'

    print(converter.convert(html_data).to_str())
    test text

Support

  • Python 3.x

  • Supports all operating systems

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html_converter-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

html_converter-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file html_converter-1.0.0.tar.gz.

File metadata

  • Download URL: html_converter-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for html_converter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b16ccfa9cc92d9e78920fd043db0f49737e4e78be0a2eaad106fd69067d4beb3
MD5 39bbc611eec44ca0cb338aa9ed5717f8
BLAKE2b-256 638e874e14657045710a11ad0e6cf748ab1ec7968832c0bc623b9a49970bafe7

See more details on using hashes here.

File details

Details for the file html_converter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: html_converter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for html_converter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6be07515b1281ac006f499bf397bd04454c39053d46ced2edcf2bd5ed2f22fdf
MD5 3e38c959ea698efed9e8f423b3142072
BLAKE2b-256 d06452cfaff6161765d0583ca3919d00203143275c1d5807c23cdfd445487ab5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page