Skip to main content

Python bindings for fast_h2m, a high-performance HTML to Markdown converter written in Rust.

Project description

fast-h2m

Python bindings for fast_h2m, a high-performance HTML to Markdown converter.

import fast_h2m

markdown = fast_h2m.convert_to_markdown("<h1>Hello</h1><p>World</p>")
result = fast_h2m.convert("<h1>Hello</h1>", {"include_document_structure": True})

For throughput-oriented conversion of common HTML, opt into the lean DOM path:

markdown = fast_h2m.convert_to_markdown(
    html,
    {"tier_strategy": "fast_dom"},
)

fast_dom skips the richer metadata, structure, visitor, selector, and repair machinery used by the full converter.

For mdream-backed lean conversion:

markdown = fast_h2m.convert_to_markdown(
    html,
    {"tier_strategy": "mdream"},
)

For chunked streaming conversion:

stream = fast_h2m.MarkdownStreamProcessor()
markdown = ""
markdown += stream.process_chunk("<h1>Hello</h1>")
markdown += stream.process_chunk("<p>World</p>")
markdown += stream.finish()

The package targets Python 3.8+ and exposes the Rust converter through PyO3.

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

fast_h2m-0.4.2.tar.gz (338.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fast_h2m-0.4.2-cp38-abi3-win_amd64.whl (912.7 kB view details)

Uploaded CPython 3.8+Windows x86-64

fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (959.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

fast_h2m-0.4.2-cp38-abi3-macosx_11_0_arm64.whl (904.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file fast_h2m-0.4.2.tar.gz.

File metadata

  • Download URL: fast_h2m-0.4.2.tar.gz
  • Upload date:
  • Size: 338.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fast_h2m-0.4.2.tar.gz
Algorithm Hash digest
SHA256 1b302a7c51414216733ad2fd3e4e6f036a1f3d4db4649b1a8c16b8661eeb8a86
MD5 3eade661b60b87c59749e6970437a481
BLAKE2b-256 ab4924bc4105c410aafab2dffb6f5612d117d87bf39893fc843e9ecce943f756

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.2.tar.gz:

Publisher: release.yml on RustedBytes/fast-h2m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_h2m-0.4.2-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: fast_h2m-0.4.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 912.7 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fast_h2m-0.4.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ebd6766be54a96d0a2441b5e1ed411f9e2583c884743b67c8978cd0ed3f24719
MD5 7c8a5b19ef7a02b97b167a36d3597ce2
BLAKE2b-256 a9ad55766d48890e0f7523daab2cc844752b7f1791795a3d439eb9c037c2c939

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.2-cp38-abi3-win_amd64.whl:

Publisher: release.yml on RustedBytes/fast-h2m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8db2615cd775e4b09ff876750df285567aa26c9afdfedc51a8fae80119ae13d5
MD5 596109be7bc64b5121b49c758789c95a
BLAKE2b-256 ad3bddc6e0d1c39b471490fb0c702c97ceab862b170e7136570546e66c6d0827

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on RustedBytes/fast-h2m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 059f8038112acb34581e6812af3596192acb40658a616c08ca5521a43892617e
MD5 dba62d1416fb2950d3efb793473a2a32
BLAKE2b-256 799e947d51c22a6c9576b8473594ed7a645ad584804e1b45ca28a569e075f570

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on RustedBytes/fast-h2m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_h2m-0.4.2-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f7d0809f891628f1b14a53e7eeeb045e44bfda0bc4879582e609f5b2f6ab272
MD5 c66fb8d6f6bcc06eb1ed817fa84cf63c
BLAKE2b-256 dcf3654898bc71544a2b3ba86ad5e7f8956098406851bc9f6c81715ec6a04c46

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.2-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on RustedBytes/fast-h2m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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