Skip to main content

SplitML

Split Markup Language (HTML and Markdown) to Groups and Nodes

Install

pip install --upgrade splitml

Usage

from splitml import HTMLSplitter, NodesGrouper, stat_tokens

html_root = Path(__file__).parent / "samples"
html_paths = sorted(list(html_root.glob("*.md.html")))[:2]
splitter = HTMLSplitter()
grouper = NodesGrouper()
for html_path in html_paths:
    # print(f"> Processing: {html_path}")
    nodes = splitter.split_html_file(html_path)
    # print(f"  - {len(nodes)} doc nodes.")
    stat_tokens(nodes)
    grouped_nodes = grouper.group_nodes(nodes)
    # print(f"  - {len(grouped_nodes)} doc groups.")
    stat_tokens(grouped_nodes)

Classes

class HTMLSplitter:
    ...

class NodesGrouper:
    ...

Functions

def split_html_str(html_str: str):
    ...

def split_html_file(html_path: Union[Path, str]):
    ...

def chunk_html_str(html_str: str):
    ...

def chunk_html_file(html_path: Union[Path, str]):
    ...
def count_tokens(text):
    ...

def stat_tokens(nodes, console_abnormal=False):
    ...

Metadata

Release files for splitml 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splitml 0.5.3
File Size Uploaded Provenance Actions
splitml-0.5.3.tar.gz 6.7 kB Without provenance Details for splitml-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splitml 0.5.3
File Interpreter ABI Platform Actions
splitml-0.5.3-py3-none-any.whl Python 3 none any Details for splitml-0.5.3-py3-none-any.whl

Total release size: 15.3 kB

Release files / splitml-0.5.3.tar.gz

Download URL splitml-0.5.3.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dad9ec7d99988801657121478a16311a754e18fa0af5ec0af7225fdb548b4656
BLAKE2b-256 checksum
How to use checksums
0c751412b1e407a40458a51ad03c77188b6ae57c1082133bf3cf0a222cfac53d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / splitml-0.5.3-py3-none-any.whl

Download URL splitml-0.5.3-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85e20896837a369857251f54f0df9e2fe40236ff0028e04449e4359eeeac8680
BLAKE2b-256 checksum
How to use checksums
989f8594893ca4856f8b6cd3c9a720abe959f196c6bec1623714915a4616fba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for splitml 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page