Skip to main content

py-unicode-linebreak

Python bindings for the Rust crate unicode-linebreak.

Installation

pip install unicode-linebreak

Usage

from unicode_linebreak import linebreaks, Allowed, Mandatory

s = 'a b\nc\r\nd e\rf end'
expected_result = [
    (2, Allowed), (4, Mandatory), (7, Mandatory), (9, Allowed),
    (11, Mandatory), (13, Allowed), (16, Mandatory)
]
assert list(linebreaks(s)) == expected_result

Returns an iterator which iterates over tuples with the binary character position of the linebreak and a boolean indicating whether the linebreak is a mandatory break.

# the end of the string is always a mandatory break
assert list(linebreaks(s))[-1] == (0, Mandatory)

# Mandatory and Allowed are just boolean values
assert expected_result[0][1] is Allowed is False
assert expected_result[-1][1] is Mandatory is True

Note that the binary character position is not the same as the readable character index, but the binary position. See the Rust method on strings char_indices().

Contribute

python -m virtualenv venv
source venv/bin/activate
pip install -r dev-requirements.txt
maturin develop && python -m unittest

Release files for unicode-linebreak 0.0.2

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

Source distribution (sdist)

Source distribution for unicode-linebreak 0.0.2
File Size Uploaded
unicode_linebreak-0.0.2.tar.gz 6.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for unicode-linebreak 0.0.2
File
unicode_linebreak-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.8 PyPy 3.8 7.3 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details
unicode_linebreak-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.9+ x86-64 Details
unicode_linebreak-0.0.2-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
unicode_linebreak-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details
unicode_linebreak-0.0.2-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details
unicode_linebreak-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.9+ x86-64 Details
unicode_linebreak-0.0.2-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details
unicode_linebreak-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details
unicode_linebreak-0.0.2-cp37-none-win_amd64.whl CPython 3.7 none Windows x86-64 Details
unicode_linebreak-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
unicode_linebreak-0.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 CPython 3.7 pymalloc macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 11.8 MB

Release files / unicode_linebreak-0.0.2.tar.gz

Download URL unicode_linebreak-0.0.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ab913a251bbafa4e1c8ffa235f6c78a150e4db6cad7d7d7abac81117713f94ee
BLAKE2b-256 checksum
How to use checksums
f14f940c4511e33cfea32cde3851a77e6cf66c14262b58455e534998002be080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
c2f853b926178ac62a4054c141f075a91ec547ed92e80f559106185dceb1d57a
BLAKE2b-256 checksum
How to use checksums
335600bb5eb1673fb3cee03db4e0b88baf24acab72e6784eba5400e048789dce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.8 PyPy 3.8 7.3
SHA-256 checksum
How to use checksums
fc3a5941e63f062513b621a7deefefed075153e59e1ccdcec28046c0814c06ce
BLAKE2b-256 checksum
How to use checksums
81b619f80e355c8c502b6abc17378f4db02d8d4a3fdfdb9a0da3bf7aab5a7ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
616a9cff9321ceb48c9026fcc739ad3123e05efb325a8674ea13228c706cdec4
BLAKE2b-256 checksum
How to use checksums
68b91c999d111af3bf853d34228f953dde48890900a298c9389904b866bab8d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp311-none-win_amd64.whl

Download URL unicode_linebreak-0.0.2-cp311-none-win_amd64.whl
Size 133.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c5d006226e50eb677b0a3c5704dca5f1fd131ee5cc8fdacb7319e31a9d592b59
BLAKE2b-256 checksum
How to use checksums
58cfdf86015139a91c00f03db0baabd53eef57583791edb08141d7e8b0deef56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b1a65268071070e9f40d2cae0f74948a7c6a653532b491c1a3b316dd255d4c5d
BLAKE2b-256 checksum
How to use checksums
925ef2b70795f73a49608de4b8aabb8271a1982170d1d57c2967e3c94d7bb38a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL unicode_linebreak-0.0.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 502.0 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
17bb8b1d09c55df3ed3bb0207d208ec8347e9b4ad50bc5bcfe51bc442c2c2262
BLAKE2b-256 checksum
How to use checksums
5cc1bd517f24a416f0f810a454e74b24aaf7ebfe122c3376320b0c8c00c25134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp310-none-win_amd64.whl

Download URL unicode_linebreak-0.0.2-cp310-none-win_amd64.whl
Size 133.2 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
900d5e9e3f38ddca2b47d17a1cd0655ac9da61d16e4e5a5381a1f9e2371688b3
BLAKE2b-256 checksum
How to use checksums
66614450b45c9c9a8ff86567f3be6f753c3e82dc33808f80623a25c017a215d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cf1e3298956b9619f015a041da7c979065b8fbbedb81a2e1984de19c4af78fd6
BLAKE2b-256 checksum
How to use checksums
d50ef422c01c956160993e958848272d3c92f27514cecd4710a6dee2dc137b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL unicode_linebreak-0.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 502.0 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
90746755abfb3c9bfd832b6a4913303bf7dc5c57db5a538485b4fc39447e00c2
BLAKE2b-256 checksum
How to use checksums
ebfbd14d743aa2d62d68fa4bf93408e5ee7cbbfa21b44f75d3104a10e746f107
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp39-none-win_amd64.whl

Download URL unicode_linebreak-0.0.2-cp39-none-win_amd64.whl
Size 133.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
8ae3adf8590d48bb7c760fe4fd66501fe651f1a31fa9e3e24639ff6d21b82dd8
BLAKE2b-256 checksum
How to use checksums
428b00d855e4a9b771a52ecd0c978e66a74e367abdc85a369427e2b8a1d1bb49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9e105ca3f9fd42ae9bb29fb00525cb904735dca416f6cb54d9c1806fc4b0b80c
BLAKE2b-256 checksum
How to use checksums
f888ce4dd9a30a4eb797b75d82190ed12aa6310848b911dbce3c140e86386332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL unicode_linebreak-0.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 502.9 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d141ca19638a64c3d4bbe81c051e903de126d13779956822e170f0f2e8ac3bac
BLAKE2b-256 checksum
How to use checksums
5986a6bc7c48d205efa99c8fbd5fe7f2d21cc83d926bf6579ffdba3ece18762e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp38-none-win_amd64.whl

Download URL unicode_linebreak-0.0.2-cp38-none-win_amd64.whl
Size 132.9 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
ca597bd2f1a5a14220165d09c23969e476351f52dfb9111f27e4977666d1118a
BLAKE2b-256 checksum
How to use checksums
748f1c8b81057684900e8eff065f899d7c751f5ec4628b21b0ab9ee1b1bb329a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
53c3fa80d228447395ca733871dc278d87087a406d073e90ff46756f91c460a3
BLAKE2b-256 checksum
How to use checksums
b4629660a4199356480be867ffc6fadf6277ff3f8513d5e11fce445b00e61c6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL unicode_linebreak-0.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 502.8 kB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b1823979fb6932e67f48b24b32540e08ad072b83ee9e46c80748183a1bca4e6
BLAKE2b-256 checksum
How to use checksums
071e6d78310defaa38d84c25bbff72c0ba1c3bd14a88d368a04795e6ec573829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp37-none-win_amd64.whl

Download URL unicode_linebreak-0.0.2-cp37-none-win_amd64.whl
Size 132.8 kB
Tags CPython 3.7 Windows x86-64
SHA-256 checksum
How to use checksums
1175998ef7d2133c36bd7e3ff1665fa97a2a0fedc1f2fec23d58f07e89d8fa3d
BLAKE2b-256 checksum
How to use checksums
eec7db86a59152942dbd9351d7bc392e552e30b1c9751cab64c2a91574e9480c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unicode_linebreak-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
504adb4ec709fcfd2c93ea40bd08a4bcf35a243c7e882edc8754a25b7e437483
BLAKE2b-256 checksum
How to use checksums
3399344ab56bfb1a47b7c93f88cc2d70c8148a8de93bb7b2ad5ee4dfb08482de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release files / unicode_linebreak-0.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL unicode_linebreak-0.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 502.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
19f454d82a085d4ef884dcfabdb60e3fb0ecf6418dd5601d91d6f0efa3348bcd
BLAKE2b-256 checksum
How to use checksums
5cdb0021a0a0c71ecfe2085b978f3dc385ca4346ce6dd22f1d54384f200080d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.13

Release history Release notifications | RSS feed

This release

0.0.2 This release

19 release files

0.0.1

19 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