Install & Compatibility
Where this runs
tested against v0.10.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.9s · import 0.000s · 87MB
88MB installed
● package 88MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Chunker
✓ from chonkie_core import Chunker
✗ from memchunk import Chunker
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0
chunk
✓ from chonkie_core import chunk
✗ from memchunk import chunk
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0
chunk_offsets
✓ from chonkie_core import chunk_offsets
✗ from memchunk import chunk_offsets
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0
merge_splits
✓ from chonkie_core import merge_splits
✗ from memchunk import merge_splits
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0. Introduced in v0.8.0.
split_at_delimiters
✓ from chonkie_core import split_at_delimiters
✗ from memchunk import split_at_delimiters
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0. Introduced in v0.6.0.
savgol_filter
✓ from chonkie_core import savgol_filter
✗ from memchunk import savgol_filter
Package renamed from 'memchunk' to 'chonkie-core' in v0.5.0. Savitzky-Golay module introduced in v0.9.0.
Demonstrates basic text chunking using the Chunker class for customizable splitting, the `chunk` convenience function, and retrieving character offsets with `chunk_offsets`. It includes examples using both ASCII and multi-byte delimiters/patterns.
from chonkie_core import Chunker, chunk, chunk_offsets
text = "This is the first sentence. This is the second sentence! And this is the third sentence, with a comma. Finally, the last one. Here is some Japanese: これは日本語のテキストです。句読点も含まれます。"
# Using Chunker class with delimiters and patterns
print("--- Using Chunker ---")
chunks_obj = list(Chunker(text, delimiters="\n.?!", patterns=["。", ",", "!"]))
for c in chunks_obj:
print(f"'{c.text}' (len: {len(c.text)})\nOffset range: {c.offset_range}")
# Using convenience function `chunk`
print("\n--- Using chunk function ---")
for c in chunk(text, delimiters=".", patterns=["。"]): # The 'chunk' function returns Chunk objects
print(f"'{c.text}' (len: {len(c.text)})\nOffset range: {c.offset_range}")
# Getting offsets directly
print("\n--- Using chunk_offsets function ---")
offsets = chunk_offsets(text, delimiters=".", patterns=["。"])
print(f"Offsets: {offsets}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'memchunk'
The package name was changed from `memchunk` to `chonkie-core` in version `0.5.0`.
fixReplace all `import memchunk` statements with `import chonkie_core` (or `from chonkie_core import ...`). Ensure you have `chonkie-core` installed via `pip install chonkie-core`.
AttributeError: 'Chunker' object has no attribute 'patterns'
The `.patterns()` method for multi-byte delimiters was added to the Python bindings in `chonkie-core` version `0.10.1`.
fixUpgrade your `chonkie-core` installation to `0.10.1` or newer: `pip install --upgrade chonkie-core`.
TypeError: argument 'text': 'int' object cannot be interpreted as a string, expected str
You are passing an integer or another non-string/non-bytes type as the primary text input to a chunking function.
fixEnsure the `text` argument passed to `Chunker` or `chunk` is a string (`str`) type. For example, `chunk(str(my_int_var))`.
Upgrade
Version history
0.10.2latest on PyPI · released May 28, 2026
Audit
Dependencies
No dependency data recorded yet.