Convert HTML to markdown or plain text
Project description
html2text_rs
Convert HTML to markdown or plain text.
Python binding to the rust rust-html2text library.
Table of Contents
Installation
pip install -U html2text_rs
Usage
1. text_markdown()
def text_markdown(html: str, width: int = 100):
"""Convert HTML to markdown text.
Args:
html (str): input html text.
width (int): wrap text to width columns. Default is 100.
"""
example:
import html2text_rs
import requests
resp = requests.get("https://en.wikipedia.org/wiki/AGM-88_HARM")
text_markdown = html2text_rs.text_markdown(resp.text)
print(text_markdown)
2. text_plain()
def text_plain(html: str, width: int = 100):
"""Convert HTML to plain text.
Args:
html (str): input html text.
width (int): wrap text to width columns. Default is 100.
"""
example:
import html2text_rs
import requests
resp = requests.get("https://en.wikipedia.org/wiki/AGM-88_HARM")
text_plain = html2text_rs.text_plain(resp.text)
print(text_plain)
3. text_rich()
def text_rich(html: str, width: int = 100):
"""Convert HTML to rich text.
Args:
html (str): input html text.
width (int): wrap text to width columns. Default is 100.
"""
example:
import html2text_rs
import requests
resp = requests.get("https://en.wikipedia.org/wiki/AGM-88_HARM")
text_rich = html2text_rs.text_rich(resp.text)
print(text_rich)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
html2text_rs-0.2.0.tar.gz
(9.1 kB
view hashes)
Built Distributions
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d795588e3564154238696c2c0f7ba7aa76ac316a98a225a91a01ed1fa031af4 |
|
MD5 | 9c788d59ee93b8ff16170ca6e331728f |
|
BLAKE2b-256 | d47f08a61c3f68bd75450c385140ffea27b870bcdd0dd99697675291e6bd0084 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd29be897483a6692f20abf475de5e741dda73a7a7b4d9ef80f5a9e1b8a5e36 |
|
MD5 | c849b47d36252844f625133c4e60ab4d |
|
BLAKE2b-256 | f9e615b673aba19ac751806d61e74e22d3e930d9d881f53020bdec1a099b39e8 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfadcdc49a7fd9eb1bfa34ec9157c80188c605bfa122f01728a4fa3a031ea2f8 |
|
MD5 | 37f86cd79b03431db0d67678f3e11cf0 |
|
BLAKE2b-256 | 8c770ebdb5a3edd2711461a20c9152ecd9fcf87a1d4eaad44a375bae72737365 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27d6910f1b6b2cec2d48767bafc2bfd6c6ea7957669b7d562a5f3fae8368a087 |
|
MD5 | 958a01ac09aa03a65b84a83b628785dc |
|
BLAKE2b-256 | 09380829199c56f8b1c436ad8664ce86c7c91b4da159a30cec1d17f2965f7e91 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c457447255450b3d8db08d0be8248a9a38ed56efed117bbd6ac5e816edfa691 |
|
MD5 | 7e9b1a2247a0a5fe0b53ebc66735057b |
|
BLAKE2b-256 | 1b57ebf3c1c8185c84b0ce985d11b2644578ae6185888948c3df6ce0f1b71038 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bc98c1c6e6b6cc1b44c45b4a3368880dee81a64ea7fa8fcf2b0023294352369 |
|
MD5 | 66977ba1e3c89760e2873ad2248bf28e |
|
BLAKE2b-256 | 631a1c3448d75abe1ccf739e907662a4e611b2b4cbdcc5840570c91f6a4da2c4 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2095c764511c0c0f6ebca9d119eef6f053a516af7aa480c1ff89dfce03b94edd |
|
MD5 | ad4a3ac4d3923b4b8faebd0f6929584a |
|
BLAKE2b-256 | 90062dca43c9fbc817a517ecfa601e931c7eef9992d0fc637696ee76f3419b52 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698e7ee4cf7ba7e1a7e4a15cf3c0e71727c6e45afbe36490016d751e8abf5468 |
|
MD5 | e01842e2b462b678a75080fc2e80dc2e |
|
BLAKE2b-256 | 7c5ca6f4a3117c813a1b652ee639e313e7239cfcfb7b1ab15c6512da068e3fae |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a8efd458558180ab8cf386b87d8aefe9432aad7d61218b65a5728006c323ee |
|
MD5 | 2f8756d94bca01bfbdba39b50d3a87f7 |
|
BLAKE2b-256 | 7d02b24cf92d5ccfd46c4110fb264f2f0a5af414334831939ee7b465e5049893 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c386b9f1099d4da51d67b04d671544c5f96e7f9de0ecd7501589307de894c5 |
|
MD5 | 7039580bb40de4b53883cafdc3c73b7b |
|
BLAKE2b-256 | da3191da1959344cfc8a2e22715c0140c5c9707853108bf6f2fa86fad8c6b764 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2397fd93de5ae76c4fddc714b14dfbdc57660a22051dd683529eaeed11153d3d |
|
MD5 | eb56fbb6ecd5d47f357a736467b6643e |
|
BLAKE2b-256 | c564692203c07500bf06a0c9049b4717b268ce12038ed9e31c61cb42e5a0eb7b |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a701dce89d31f5177badb195a49dbc1c0419193a69ab92e8900792ba6daf92c2 |
|
MD5 | 9fa6622138edd1c39164d7e5dc1b263b |
|
BLAKE2b-256 | 5c93407e8a8a76505af1aea51224399386e33a9bb3aa6fc90f3c299128688c55 |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebe858f461ab874afedec8447fc12bf21a3c54ef4fbd0fa2efcab222d0301e69 |
|
MD5 | a53170c93629257a3fe598b2294dd744 |
|
BLAKE2b-256 | 8af740d93a4c84496f23b6f1aa4d21db571a51e6db11168c4dc8c6e14188b4dc |
Close
Hashes for html2text_rs-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a09396710e3fcead9ab37857b6f7949cc791a0f815c75d964d91a25030871539 |
|
MD5 | 7420d96680501e0e3a2e3221ddba98e3 |
|
BLAKE2b-256 | ee8f2da669b146663876ad4200e5de873d226447ff89a030ec0f0765f7f9d939 |