Python 3.8+

Install the library, not a remix

The tab already printed the pip line. Core is enough to chunk text, markdown, JSON, CSV, HTML, and the code strategies. Extras pull the heavy stuff only when you ask.

pip install chunking-strategy
pip install chunking-strategy[tiktoken]   # cl100k_base windows
pip install chunking-strategy[pdf]
pip install chunking-strategy[ml]         # embeddings / semantic
pip install chunking-strategy[media]      # audio / video / images; POSIX
pip install chunking-strategy[tika]       # POSIX, 1400+ formats
[all] pulls torch, OpenCV, and Tika. Install extras you actually need. If a strategy needs one, you get MissingExtraError with the one-line pip hint.

Thirty seconds in Python

from chunking_strategy import create_chunker, ChunkerOrchestrator

chunker = create_chunker("sentence_based", max_sentences=2)
print(chunker.chunk("Hello. This is two sentences.").chunks)

# Or let the orchestrator pick from the path
result = ChunkerOrchestrator().chunk_file("report.pdf")
print(result.strategy_used, len(result.chunks), result.quality_score)

Thirty seconds on the CLI

python -m chunking_strategy --version
python -m chunking_strategy list-strategies --tier lab
python -m chunking_strategy chunk doc.txt --strategy sentence_based
python -m chunking_strategy compare doc.txt -s fixed_size,sentence_based,markdown_chunker

Windows vs POSIX

Core is cross-platform. [media], [tika], and [hardware] stay POSIX-oriented. CI smokes core on Windows: import, fixed_size / sentence_based, list-strategies --tier lab.

From a clone

git clone https://github.com/sharanharsoor/chunking.git
cd chunking
pip install -e ".[dev]"
pytest tests/ -q

Contributing a lab strategy means a Python chunker, a golden fixture, then a JS port. The tab is not the place to prototype by pasting generated worker code. See Bring your own and DEVELOPER_GUIDE.md.

Package: chunking-strategy on PyPI.