# Sentence Stream
A small sentence splitter for text streams.
## Install
``` sh
pip install sentence-stream
```
## Example
``` python
from sentence_stream import stream_to_sentences
text_chunks = [
"Text chunks that a",
"re not on",
" word or se",
"ntence boundarie",
"s. But, they w",
"ill sti",
"ll get sp",
"lit right",
"!!! Goo",
"d",
]
assert list(stream_to_sentences(text_chunks)) == [
"Text chunks that are not on word or sentence boundaries.",
"But, they will still get split right!!!",
"Good",
]
```
For async streams, use `async_stream_to_sentences`.
Raw data
{
"_id": null,
"home_page": null,
"name": "sentence-stream",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": null,
"keywords": "home, assistant, sentence boundary",
"author": null,
"author_email": "The Home Assistant Authors <hello@home-assistant.io>",
"download_url": "https://files.pythonhosted.org/packages/7d/96/e982ce20637bf6f78b1733c6fe5da29a357695d84a7928b5866a5ab5802a/sentence_stream-1.2.0.tar.gz",
"platform": "any",
"description": "# Sentence Stream\n\nA small sentence splitter for text streams.\n\n## Install\n\n``` sh\npip install sentence-stream\n```\n\n## Example\n\n``` python\nfrom sentence_stream import stream_to_sentences\n\ntext_chunks = [\n \"Text chunks that a\",\n \"re not on\",\n \" word or se\",\n \"ntence boundarie\",\n \"s. But, they w\",\n \"ill sti\",\n \"ll get sp\",\n \"lit right\",\n \"!!! Goo\",\n \"d\",\n]\n\nassert list(stream_to_sentences(text_chunks)) == [\n \"Text chunks that are not on word or sentence boundaries.\",\n \"But, they will still get split right!!!\",\n \"Good\",\n]\n```\n\nFor async streams, use `async_stream_to_sentences`.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A small sentence splitter for text streams",
"version": "1.2.0",
"project_urls": {
"Source Code": "http://github.com/OHF-Voice/sentence-stream"
},
"split_keywords": [
"home",
" assistant",
" sentence boundary"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8076f029b12b009bb7b76e286572a4010edd467ae97c2a65eb8214fe1987d2d1",
"md5": "2dc0d4c2be975da071de20a1774e5e99",
"sha256": "01874a7e70efc578f891bafd3bbfa84c074fcbbfe29e1f940df969ce59e160a3"
},
"downloads": -1,
"filename": "sentence_stream-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2dc0d4c2be975da071de20a1774e5e99",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 8065,
"upload_time": "2025-08-27T18:55:25",
"upload_time_iso_8601": "2025-08-27T18:55:25.835699Z",
"url": "https://files.pythonhosted.org/packages/80/76/f029b12b009bb7b76e286572a4010edd467ae97c2a65eb8214fe1987d2d1/sentence_stream-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7d96e982ce20637bf6f78b1733c6fe5da29a357695d84a7928b5866a5ab5802a",
"md5": "bdeb89e30c7c2d268f18373baa9ba0b0",
"sha256": "92c7b6aa515d1d2a44693b719c77e3144dd6bbccd405261eee7a065d01191f71"
},
"downloads": -1,
"filename": "sentence_stream-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "bdeb89e30c7c2d268f18373baa9ba0b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 9492,
"upload_time": "2025-08-27T18:55:27",
"upload_time_iso_8601": "2025-08-27T18:55:27.573301Z",
"url": "https://files.pythonhosted.org/packages/7d/96/e982ce20637bf6f78b1733c6fe5da29a357695d84a7928b5866a5ab5802a/sentence_stream-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 18:55:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OHF-Voice",
"github_project": "sentence-stream",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "sentence-stream"
}