sentence-stream
A small sentence splitter for text streams
What it is and what it does
Sentence Stream is a lightweight sentence splitter designed to handle text that arrives in arbitrary chunks—such as streaming responses from language models or network I/O—and reassemble them into complete sentences. Rather than requiring text to be buffered until word or sentence boundaries align, it processes chunks as they arrive and yields complete sentences when boundaries are detected.
The package provides both synchronous (stream_to_sentences) and asynchronous (async_stream_to_sentences) interfaces, making it suitable for integration into streaming pipelines. It depends only on the regex library and supports Python 3.9 through 3.13, keeping installation friction minimal.
Use it for:
- Process streaming LLM responses to extract complete sentences as they arrive, without buffering entire outputs.
- Split real-time chat or voice transcription streams into sentence units for downstream NLP processing.
- Handle network-streamed text (e.g., HTTP chunked responses) and emit complete sentences incrementally.
- Build sentence-aware streaming pipelines in async applications where text arrives in unpredictable fragment sizes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Splits text streams into sentences even when chunks arrive at arbitrary boundaries, with support for both synchronous and asynchronous iteration.
Yes, if you need to split sentences from text that arrives in arbitrary chunks or streams. The low install friction, active maintenance, permissive license, and focused scope make it a straightforward addition to streaming pipelines. Not necessary if your text is already buffered or sentence-aligned.
Install
sentence-stream on PyPI
pip
pip install sentence-streamuv
uv add sentence-streampoetry
poetry add sentence-streamInstalling sentence-stream
Before you install
Low friction: pure Python wheel with a single runtime dependency (regex). Last commit 2026-08-11 and active maintenance status suggest the project is current.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install sentence-stream
from sentence_stream import stream_to_sentences
text_chunks = ["Hello world", ". This is", " a test."]
sentences = list(stream_to_sentences(text_chunks))
# For async: from sentence_stream import async_stream_to_sentences
Requires Python 3.9 or later.
Verify before relying
- Whether regex dependency adds meaningful overhead or compatibility constraints beyond what sentence-stream itself requires.
- Performance characteristics on very large streams or highly fragmented chunk boundaries.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — regex |
| Maintenance | actively maintained — 218 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 375,237/month — #7,140 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sentence_stream-1.3.0-py3-none-any.whl
Keywords: home, assistant, sentence boundary
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
semantic-text-splitterSplits long text into semantically meaningful…
permissive · top 15,000 on PyPI
pysbdDetects sentence boundaries in text using…
permissive · top 5,000 on PyPI
segtokSplits Indo-European text into sentences and…
permissive · top 15,000 on PyPI
minisbdDetects sentence boundaries in text across many…
agpl · top 15,000 on PyPI
memchunkSplits text into semantic chunks at delimiters…
permissive · top 15,000 on PyPI
PyRuSHPyRuSH segments clinical and telegraphic text…
permissive · top 15,000 on PyPI
razdelSplits Russian text into sentences and tokens…
permissive · top 15,000 on PyPI
chonkie-corechonkie-core splits text at semantic boundaries…
permissive · top 15,000 on PyPI
unisegDetermines Unicode text segmentation…
permissive · top 15,000 on PyPI
streamlinkStreamlink extracts video streams from various…
permissive · top 15,000 on PyPI