Skip to main content

bs4-token-ext

Add token counting capabilities to BeautifulSoup tags for LLM applications.

LLM(大規模言語モデル)向けに、BeautifulSoup のタグにトークン数をカウントする機能を追加する。

Usage

from bs4_token_ext import TokenAwareBeautifulSoup

html = "<div><p>Hello, world!</p></div>"
soup = TokenAwareBeautifulSoup(html, 'html.parser')
div = soup.find('div')
p = soup.find('p')

print(p.token_count) 
print(p.token_count_with_html)  
print(div.token_count)  
print(div.token_count_with_html)  

Metadata

Release files for bs4-token-ext 0.0.2

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

Source distribution (sdist)

Source distribution for bs4-token-ext 0.0.2
File Size Uploaded Provenance Actions
bs4_token_ext-0.0.2.tar.gz 38.7 kB Without provenance Details for bs4_token_ext-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bs4-token-ext 0.0.2
File Interpreter ABI Platform Actions
bs4_token_ext-0.0.2-py3-none-any.whl Python 3 none any Details for bs4_token_ext-0.0.2-py3-none-any.whl

Total release size: 42.3 kB

Release files / bs4_token_ext-0.0.2.tar.gz

Download URL bs4_token_ext-0.0.2.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
565e0578230cd4c059f1623161542fbd80aaeb524d5ef180495b4b5be707e0be
BLAKE2b-256 checksum
How to use checksums
8c33e8b29456b8b082200fdcd4ca4e4e3429d1eed884cda74d9bd887399e1ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / bs4_token_ext-0.0.2-py3-none-any.whl

Download URL bs4_token_ext-0.0.2-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8b3bda2d59fcd847c0c7fbba5be917e5213005eaa0a37868c1106ca73949e12
BLAKE2b-256 checksum
How to use checksums
b10170f1e07203620c5f4c93a55a6b7d8c97b15b9c84c15132b63d5f801d21c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for bs4-token-ext 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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