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://tmz.com")
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://tmz.com")
text_plain = html2text_rs.text_plain(resp.text)
print(text_plain)
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.1.0.tar.gz
(8.0 kB
view hashes)
Built Distributions
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ec15b28c567b1ff3783e496ba8cde154b25a00bbee1cd86b1c0d3c4763ce23c |
|
MD5 | 83e75b491d9daed1fab30fc44aceee66 |
|
BLAKE2b-256 | 93ebdd5a2c435d8ef191cd55dc55500d1b53b55147cf210e659fad3a2f951d25 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba37f73b6c9cdb2ee39d729618035cdfdfb4cf38447aca4437a708f2708b44f0 |
|
MD5 | ed4b5edbb3da450ac5f188b7daea1469 |
|
BLAKE2b-256 | f42b3787c37497570c6fb6a05aa5a8939c0af39ee557f856bb101cc7fce26d21 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c77afc6b4e21f8a38382840eac1cc2bfbb8ee55e487700531d6f9ec081e1e55 |
|
MD5 | 72ad250f9b9de59ee39b1bfaebc91824 |
|
BLAKE2b-256 | 9fbf7fd31b3294658d6941e0b1e32cc2c15c472a32c9cdc26d70151325825b95 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9dbc9687408553a9b5f9d59ddf7f41c01431dbc8ff024c6f97d46304afe550 |
|
MD5 | 3dd7a78118cf119d1c325881dcaa65af |
|
BLAKE2b-256 | e40a203cc8e4f366ee03ab42c7714ef0ff2ff2c5a5786e96ac2cc1e2450c5c1e |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46eb20706a561cf511f714ed4bc4a9526147529dedafa7651ed81ccbed0a8d0f |
|
MD5 | 73d93e1eed1646c56a6f6b05456a8fed |
|
BLAKE2b-256 | a5bace0ef14d7e26e14f8315eb7872783b128f1282072216ff9250050050ea9e |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7010e46c4f8dfd723af7305508158e3a832cb106c4917633b0765cdb2aef8970 |
|
MD5 | 8959584c06acaad008a1ed57a715ee0c |
|
BLAKE2b-256 | bd1cd955071ec162fa7241273c6bbb49d738cf3fab1e415dcadeede6fcbc023b |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 962b2ac818c629ca9f9e7eb13f2079e1f76ae791fc4ddb63b9b38b6eb2540368 |
|
MD5 | f26bd93e0a5f1a6c8561b203168fc6e2 |
|
BLAKE2b-256 | bdb0dfcd887be51fbfcf955106ae872f0533d3a4c8b377207bee430faa21f478 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e010960c489328373dc1a00c2aa54bc3d73e6582eb81e37a3759bc2fdf8613 |
|
MD5 | 69e1704e381c2641fa0b7f3bdea65580 |
|
BLAKE2b-256 | 860997f519c6eefe0fea54a1bb176e7ef540451995d5b1f95cd7d0e6403f9599 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ead841a66914b69d76af60b588cc8b0b244eb27f3b13b2842cf44a183d090a9 |
|
MD5 | c0d0c6fe87602b63d405dfdcdf11c8d3 |
|
BLAKE2b-256 | e43e52757f8a23ad2ac22322d35ffb4d2765111155029d96864fc3398ebb14b1 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba7311f7d8fede89247deac58a1c0ecbd4002f880f0bca666cf1f14f9ab45d6 |
|
MD5 | fba3f957f996631ab2fd2748259f9aba |
|
BLAKE2b-256 | 067c626501039b834b285a474831c73fb6a52b332f1eafb54145abaa9b77089a |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b855b2eb93b76a3e4b9ac7e175bf037c1bb5c44b576fbff50e2d68e4b1ac284 |
|
MD5 | fb175d8d9e76b1c4a60d5aaacb582931 |
|
BLAKE2b-256 | c3bfa1ede74e477ecabac544c30abb730bb1eccf577e0a6ee5f535283b29fc5b |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776a149dce45b2b7775b6d0f612758e007ecbc9dcb1a23f16538e6a14b4de956 |
|
MD5 | d967af43132fce41c2eccfafa1fccd89 |
|
BLAKE2b-256 | 1e67885c9564610bad133c57265d762ea281ffe5481771672f00730f7486fde4 |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e10b701254e343ed64f227f25ac8e1597cd9154346967dba5383c477aabd7d |
|
MD5 | 9a0db3605a7141fcbec4bc9534faa9e6 |
|
BLAKE2b-256 | 3763251969e1acf88b444890a1f3f05f892ac4c0f6691d00d464359eb1b64dbf |
Close
Hashes for html2text_rs-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5bfe41d6f0f7ae4f3e5bc3ad41098fc100553e0d35b36f7b5d98374b3df28db |
|
MD5 | fca6f74a68d2c3697d758c3d990ee378 |
|
BLAKE2b-256 | 49233089a7cab1e4475d221026869cedf8d6bb624e5fcd375b25e9cd3c2d089c |