skillfed

sentence-stream

A small sentence splitter for text streams

sentence-stream v1.3.0 375.2K downloads/30d#7,140 on PyPI3
Permissive license Apache-2.0 Active released

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-stream

uv

uv add sentence-stream

poetry

poetry add sentence-stream

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Text Processing :: Linguistic

Tags

sentence splitter streamingtext stream sentence boundarysplit sentences from chunkssentence tokenization streamingasync sentence splittingsentence boundary detectionstream text to sentences
streamingnlp

More Linguistic packages