Skip to main content

file_read_backwards

https://img.shields.io/pypi/v/file_read_backwards.svg Documentation Status Updates

Memory efficient way of reading files line-by-line from the end of file

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.

Metadata

Release files for file-read-backwards 3.0.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 file-read-backwards 3.0.0
File Size Uploaded
file_read_backwards-3.0.0.tar.gz 27.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for file-read-backwards 3.0.0
File Interpreter ABI Platform
file_read_backwards-3.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 35.6 kB

Release files / file_read_backwards-3.0.0.tar.gz

Download URL file_read_backwards-3.0.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
512c3e534043527a8fae2a0b7151aa255f2da303e77fd40f7dcf42a1e091cc26
BLAKE2b-256 checksum
How to use checksums
e20f04d8a9877d80c26506cad53e3ff7024747e9429a5a06479c68f060948d1a
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.0.0-py2.py3-none-any.whl

Download URL file_read_backwards-3.0.0-py2.py3-none-any.whl
Size 7.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
09fbac8bbf6d72c053c6e789768671002806c572d210fbe6861088a4a8bd0968
BLAKE2b-256 checksum
How to use checksums
131ed8c2f7c72a14e5f432ae78e9f263c6c9f6fb170d14939e130781430ba276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

3.2.0

2 release files

3.1.0

2 release files

This release

3.0.0 This release

2 release files

2.0.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 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