file_read_backwards
Memory efficient way of reading files line-by-line from the end of file
Free software: MIT license
Documentation: https://file-read-backwards.readthedocs.io.
Features
This package is for reading file backward line by line as unicode in a memory efficient manner for both Python 2.7 and Python 3.
It currently supports ascii, latin-1, and utf-8 encodings.
It supports “\r”, “\r\n”, and “\n” as new lines.
Usage Examples
Another example using python3.11:
from file_read_backwards import FileReadBackwards
with FileReadBackwards("/tmp/file", encoding="utf-8") as frb:
# getting lines by lines starting from the last line up
for l in frb:
print(l)
Another way to consume the file is via readline(), in python3.11:
from file_read_backwards import FileReadBackwards
with FileReadBackwards("/tmp/file", encoding="utf-8") as frb:
while True:
l = frb.readline()
if not l:
break
print(l, end="")
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
1.0.0 (2016-12-18)
First release on PyPI.
1.1.0 (2016-12-31)
Added support for “latin-1”.
Marked the package “Production/Stable”.
1.1.1 (2017-01-09)
Updated README.rst for more clarity around encoding support and Python 2.7 and 3 support.
1.1.2 (2017-01-11)
Documentation re-arrangement. Usage examples are now in README.rst
Minor refactoring
1.2.0 (2017-09-01)
Include context manager style as it provides cleaner/automatic close functionality
1.2.1 (2017-09-02)
Made doc strings consistent to Google style and some code linting
1.2.2 (2017-11-19)
Re-release of 1.2.1 for ease of updating pypi page for updated travis & pyup.
2.0.0 (2018-03-23)
Mimicing Python file object behavior.
FileReadBackwards no longer creates multiple iterators (a change of behavior from 1.x.y version)
Adding readline() function retuns one line at a time with a trailing new line and empty string when it reaches end of file. The fine print: the trailing new line will be os.linesep (rather than whichever new line type in the file).
3.0.0 (2023-03-29)
Officially support Python 3.7 - 3.11.
3.1.0 (2024-05-02)
Officially support Python 3.7 - 3.12
3.2.0 (2025-04-21)
Officially support Python 3.13.
Metadata
Release files for file-read-backwards 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| file_read_backwards-3.2.0.tar.gz | 21.8 kB | Without provenance | Details for file_read_backwards-3.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| file_read_backwards-3.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for file_read_backwards-3.2.0-py2.py3-none-any.whl |
Total release size: 29.7 kB
Release files / file_read_backwards-3.2.0.tar.gz
| Download URL | file_read_backwards-3.2.0.tar.gz |
|---|---|
| Size | 21.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5478d305ebaeaae8fe3c6585a24dfc3262170224450acc9321398f0d26cdd109
|
|
BLAKE2b-256 checksum How to use checksums |
5e53804f4321dd72e2953c6d5875e9d07d79415a1f8055d5197b92d6d97da19a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / file_read_backwards-3.2.0-py2.py3-none-any.whl
| Download URL | file_read_backwards-3.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
15b261b3b65cd1452f5a66fad3e81e3fd15b1ba2c0e3a224ef0ba0f6392ec1a9
|
|
BLAKE2b-256 checksum How to use checksums |
317e4a844e232df643bdccef71819f32b3ba8bd716b4c9c3cbf39a3a579f694a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for file-read-backwards 3.2.0
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.