Skip to main content

isplit logo

Lazy, typed string splitting helpers for Python, backed by Rust.

PyPI Python versions CI MIT License

isplit scans a string once and yields pieces as soon as separators are found. It is useful for tokenizer-style code where callers want to consume tokens lazily instead of allocating the whole split result up front.

The iterator implementation is backed by a small PyO3 Rust extension when available, with the original pure-Python implementation kept as a fallback.

Installation

python -m pip install isplit-rs

The PyPI distribution is named isplit-rs, while the Python package is imported as isplit.

Quick start

from isplit import irsplit, isplit

list(isplit("A+B+C+D", "+"))
# ["A", "B", "C", "D"]

list(isplit("AAA,,BBB", ",,"))
# ["AAA", "BBB"]

list(irsplit("A+B+C+D", "+"))
# ["D", "C", "B", "A"]

Or consume pieces lazily:

from isplit import isplit

for token in isplit("AAA,BBB,CCC", ","):
    print(token)

Why isplit?

Feature What it gives you
Lazy iteration Consume split pieces one at a time
Forward and reverse splits Use isplit or irsplit depending on scan direction
Rust acceleration Use the PyO3 extension when available
Pure-Python fallback Keep imports working even without the extension
Typed package Ship a py.typed marker for type checkers

API

isplit(text: str, sep: str) -> Iterator[str]
irsplit(text: str, sep: str) -> Iterator[str]
  • isplit(text, sep) yields pieces from left to right.
  • irsplit(text, sep) yields pieces from right to left.

Both functions follow str.split semantics for non-empty separators and raise ValueError when sep is empty.

Verify Rust acceleration

Installed wheels include the native Rust extension. To check that your environment is using it:

python - <<'PY'
import isplit._rust as rust

print(rust.__file__)
print(list(rust.isplit("A+B+C", "+")))
PY

The printed path should point to a compiled extension such as isplit/_rust.abi3.so on Linux/macOS or isplit/_rust.pyd on Windows.

Release files for isplit-rs 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isplit-rs 0.2.0
File Size Uploaded
isplit_rs-0.2.0.tar.gz 9.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for isplit-rs 0.2.0
File Interpreter ABI Platform
isplit_rs-0.2.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
isplit_rs-0.2.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
isplit_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 636.1 kB

Release files / isplit_rs-0.2.0.tar.gz

Download URL isplit_rs-0.2.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2b74d1456fdf7333daca3dcb78422046ea8d11e77acbd77a7021a4bb2b22e8d7
BLAKE2b-256 checksum
How to use checksums
17eae9a29cc4fe4903feca8fdf8092bdff99839abddf774b819d07e4645bc69f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / isplit_rs-0.2.0-cp39-abi3-win_amd64.whl

Download URL isplit_rs-0.2.0-cp39-abi3-win_amd64.whl
Size 129.0 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
40c3a08b990d8ec2dfd90b71b64328d50a0197bf633f147b79099f639bf2463b
BLAKE2b-256 checksum
How to use checksums
2a5fddb243dac4e72405d82d4ab75b13c95a8d6c13d396746129d13eed03af66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / isplit_rs-0.2.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL isplit_rs-0.2.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 267.9 kB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
99ef1c75fc702536ad24624f949f9394fdd0ccaf0d458ff904f5f12b97beb349
BLAKE2b-256 checksum
How to use checksums
117df860d1ddbf5a6ca3436a3fd3f1e8f818f14ce80262d0ede3126a0278a559
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / isplit_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL isplit_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Size 229.7 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9961ad8637dc2dfd3d2f698c9aa6f822b2e4b001832f62b4b0c04765f3eac062
BLAKE2b-256 checksum
How to use checksums
4286c1c9d83b9fa00274fbb2bd87f5314967ccd5bf33103b85f06aacc89b9fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

4 release files

This release

0.2.0 This release

4 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page