/
Depends on
- dh-python (dh-sequence-python3)
- pytest (python3-pytest)
- pytest-mock (python3-pytest-mock)
- python3-defaults (python3-all)
- setuptools (python3-setuptools)
- debhelper-compat
README (full)
file_read_backwards
:target: https://file-read-backwards.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
:target: https://pyup.io/repos/github/RobinNil/file_read_backwards/ :alt: Updates
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.
| dir | debian/ |
| dir | docs/ |
| dir | file_read_backwards/ |
| dir | file_read_backwards.egg-info/ |
| dir | tests/ |
| file | AUTHORS.rst |
| file | CONTRIBUTING.rst |
| file | HISTORY.rst |
| file | LICENSE |
| file | MANIFEST.in |
| file | PKG-INFO |
| file | README.rst |
| file | setup.cfg |
| file | setup.py |