Skip to main content

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

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.0.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.0-cp38-abi3-win_amd64.whl (912.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

fast_h2m-0.4.0-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.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (959.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

fast_h2m-0.4.0-cp38-abi3-macosx_11_0_arm64.whl (904.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fast_h2m-0.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 dbad80b4e844f95a9f3058c5cc8b01d86fea9fa40af34e82ec5709aa0962f323
MD5 7ea318dc063755b7b83a7820843dbf09
BLAKE2b-256 ae227a6b70e61bab086a9fe06d994ad1d870927e61e4646c3be4f300ccc36b89

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.0.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.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: fast_h2m-0.4.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 912.6 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.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f086e084c16207637cf81cfa3ca4c45317b2f7bd5c71792a58972e0e143aecbf
MD5 d54374e67783947f9c92271aa3fe11f0
BLAKE2b-256 94030d64c2ab95ca9ba8bb0f44a1f3b9317bd839ac308c32e8c3676374a1314e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.0-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.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a796199add77bf0182c56a527202a86a70c58641d8218c93af9cde9d445aafb7
MD5 27e3843e4c78c6158d3fc86910bee9ef
BLAKE2b-256 146f01a2d5f1d77a0b76e49a3c688ffd8df8f436e4cbdad27ce7ca20923a6178

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.0-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.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7b0fa750ac30266c887c2e4e7ec4ef1f871903cd81cc196ad8642fedd88d1166
MD5 61c71f89be89fde7aa07d9df8f2fc629
BLAKE2b-256 73f53df5ad1879b78c59108852f969115340cdd91908649b4e27431b5db8292f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.0-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.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_h2m-0.4.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebf9293d28939dbb81ff1e2975633f0730901252ae8c404d11d4256061e99aca
MD5 0ab1f34a3201a752e681bbfb9a5e6acd
BLAKE2b-256 7124d33aebe78de2820afd8ca123df8b360e35caf98abdb2dc92d1a3d528dd63

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_h2m-0.4.0-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