Skip to main content

Read lines of data with an arbitrary delimiter, like a null, newline or even an x.

It passes pylint, passes pycodestyle, passes pydocstyle, is thoroughly unit tested, and runs on CPython 2.7, CPython 3.x, Pypy 7.3.1, and Pypy3 7.3.1.

It gains a lot of speed by eschewing single-character reads.

Usage looks like:
import readline0
file_ = open('/etc/shells', 'r')
for line in readline0.readline0(file_=file_, separator=b'\n'):
...     print(line)
...
b'# /etc/shells: valid login shells'
b'/bin/sh'
b'/bin/dash'
b'/bin/bash'
b'/bin/rbash'

Of course separator need not be a newline; it defaults to a null byte. Also file_ defaults to sys.stdin. And there’s a blocksize argument as well, which defaults to 64K.

Metadata

Release files for readline0 1.7

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

Source distribution (sdist)

Source distribution for readline0 1.7
File Size Uploaded Provenance Actions
readline0-1.7.tar.gz 4.1 kB Without provenance Details for readline0-1.7.tar.gz

Release files / readline0-1.7.tar.gz

Download URL readline0-1.7.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
505774f90826237f1228f6f0118b11bdb66824c8610322ced836a76247326791
BLAKE2b-256 checksum
How to use checksums
cdc3eb05bfc67e2a77bb38656a7e5dd56811019033d54aed3d19c50ea108e4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Security for readline0 1.7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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