{ "info": { "author": "NyanKiyoshi", "author_email": "hello@vanille.bid", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "
\n

HTML to DraftJS

\n

Convert HTML into DraftJS JSON format.

\n

\n \n Requirement Status\n \n \n Coverage Status\n \n \n Version\n \n

\n

\n \n Commits since latest release\n \n \n Supported versions\n \n \n Supported implementations\n \n

\n
\n\n## Installation\n```\npip install html-to-draftjs\n```\n\n## Usage\n\n```python\nfrom html_to_draftjs import html_to_draftjs\n\n\njson = html_to_draftjs(\"\"\"\n

My Page

\n\n

Introduction

\n\n

Some content that is pretty interesting

\n

Don't forget to follow me!

\n\n

Illustration

\n

\"image\"

\n\"\"\")\n```\n\n## API\n### `html_to_draftjs(raw_html_content: str[, features=\"lxml\", strict=False]) -> dict`\nConverts a given HTML input into JSON.\n\n- `features` the features for the HTML tree-builder. By default it is set to `lxml` which is fast and powerful.\n- `strict` (boolean), if false, it will only warn on invalid operations. If true, it will raise errors.\n\n### `soup_to_draftjs(bs_object: BeautifulSoup[, strict=False]) -> dict`\nConverts a given beautiful soup into JSON. Useful if you have to select a given part of the HTML content to convert it (e.g. `#content`).\n\n- `strict` (boolean), if false, it will only warn on invalid operations. If true, it will raise errors.\n\n## Supported Tags and Attributes\n\n### Blocks\n- `
`, `

`\n- `

` ... `

`\n- `
`\n- `
  • ` and `
      ` (doesn't support `