| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: file-read-backwards |
| 3 |
Version: 3.2.0 |
| 4 |
Summary: Memory efficient way of reading files line-by-line from the end of file |
| 5 |
Home-page: https://github.com/RobinNil/file_read_backwards |
| 6 |
Author: Robin Robin |
| 7 |
Author-email: [email protected] |
| 8 |
License: MIT |
| 9 |
Keywords: file_read_backwards |
| 10 |
Classifier: Development Status :: 5 - Production/Stable |
| 11 |
Classifier: Intended Audience :: Developers |
| 12 |
Classifier: Natural Language :: English |
| 13 |
Classifier: Programming Language :: Python :: 3 |
| 14 |
Classifier: Programming Language :: Python :: 3.7 |
| 15 |
Classifier: Programming Language :: Python :: 3.8 |
| 16 |
Classifier: Programming Language :: Python :: 3.9 |
| 17 |
Classifier: Programming Language :: Python :: 3.10 |
| 18 |
Classifier: Programming Language :: Python :: 3.11 |
| 19 |
Classifier: Programming Language :: Python :: 3.12 |
| 20 |
Classifier: Programming Language :: Python :: 3.13 |
| 21 |
License-File: LICENSE |
| 22 |
License-File: AUTHORS.rst |
| 23 |
|
| 24 |
=============================== |
| 25 |
file_read_backwards |
| 26 |
=============================== |
| 27 |
|
| 28 |
|
| 29 |
.. image:: https://img.shields.io/pypi/v/file_read_backwards.svg |
| 30 |
:target: https://pypi.python.org/pypi/file_read_backwards |
| 31 |
|
| 32 |
.. image:: https://readthedocs.org/projects/file-read-backwards/badge/?version=latest |
| 33 |
:target: https://file-read-backwards.readthedocs.io/en/latest/?badge=latest |
| 34 |
:alt: Documentation Status |
| 35 |
|
| 36 |
.. image:: https://pyup.io/repos/github/RobinNil/file_read_backwards/shield.svg |
| 37 |
:target: https://pyup.io/repos/github/RobinNil/file_read_backwards/ |
| 38 |
:alt: Updates |
| 39 |
|
| 40 |
|
| 41 |
Memory efficient way of reading files line-by-line from the end of file |
| 42 |
|
| 43 |
|
| 44 |
* Free software: MIT license |
| 45 |
* Documentation: https://file-read-backwards.readthedocs.io. |
| 46 |
|
| 47 |
|
| 48 |
Features |
| 49 |
-------- |
| 50 |
|
| 51 |
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. |
| 52 |
|
| 53 |
It currently supports ascii, latin-1, and utf-8 encodings. |
| 54 |
|
| 55 |
It supports "\\r", "\\r\\n", and "\\n" as new lines. |
| 56 |
|
| 57 |
Usage Examples |
| 58 |
-------------- |
| 59 |
|
| 60 |
Another example using `python3.11`:: |
| 61 |
|
| 62 |
from file_read_backwards import FileReadBackwards |
| 63 |
|
| 64 |
with FileReadBackwards("/tmp/file", encoding="utf-8") as frb: |
| 65 |
|
| 66 |
# getting lines by lines starting from the last line up |
| 67 |
for l in frb: |
| 68 |
print(l) |
| 69 |
|
| 70 |
|
| 71 |
Another way to consume the file is via `readline()`, in `python3.11`:: |
| 72 |
|
| 73 |
from file_read_backwards import FileReadBackwards |
| 74 |
|
| 75 |
with FileReadBackwards("/tmp/file", encoding="utf-8") as frb: |
| 76 |
|
| 77 |
while True: |
| 78 |
l = frb.readline() |
| 79 |
if not l: |
| 80 |
break |
| 81 |
print(l, end="") |
| 82 |
|
| 83 |
Credits |
| 84 |
--------- |
| 85 |
|
| 86 |
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. |
| 87 |
|
| 88 |
.. _Cookiecutter: https://github.com/audreyr/cookiecutter |
| 89 |
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
======= |
| 94 |
History |
| 95 |
======= |
| 96 |
|
| 97 |
1.0.0 (2016-12-18) |
| 98 |
------------------ |
| 99 |
|
| 100 |
* First release on PyPI. |
| 101 |
|
| 102 |
1.1.0 (2016-12-31) |
| 103 |
------------------ |
| 104 |
|
| 105 |
* Added support for "latin-1". |
| 106 |
* Marked the package "Production/Stable". |
| 107 |
|
| 108 |
1.1.1 (2017-01-09) |
| 109 |
------------------ |
| 110 |
|
| 111 |
* Updated README.rst for more clarity around encoding support and Python 2.7 and 3 support. |
| 112 |
|
| 113 |
1.1.2 (2017-01-11) |
| 114 |
------------------ |
| 115 |
|
| 116 |
* Documentation re-arrangement. Usage examples are now in README.rst |
| 117 |
* Minor refactoring |
| 118 |
|
| 119 |
1.2.0 (2017-09-01) |
| 120 |
------------------ |
| 121 |
|
| 122 |
* Include context manager style as it provides cleaner/automatic close functionality |
| 123 |
|
| 124 |
1.2.1 (2017-09-02) |
| 125 |
------------------ |
| 126 |
|
| 127 |
* Made doc strings consistent to Google style and some code linting |
| 128 |
|
| 129 |
|
| 130 |
1.2.2 (2017-11-19) |
| 131 |
------------------ |
| 132 |
|
| 133 |
* Re-release of 1.2.1 for ease of updating pypi page for updated travis & pyup. |
| 134 |
|
| 135 |
2.0.0 (2018-03-23) |
| 136 |
------------------ |
| 137 |
|
| 138 |
Mimicing Python file object behavior. |
| 139 |
|
| 140 |
* FileReadBackwards no longer creates multiple iterators (a change of behavior from 1.x.y version) |
| 141 |
* Adding readline() function retuns one line at a time with a trailing new line and empty string when it reaches end of file. |
| 142 |
The fine print: the trailing new line will be `os.linesep` (rather than whichever new line type in the file). |
| 143 |
|
| 144 |
3.0.0 (2023-03-29) |
| 145 |
------------------ |
| 146 |
|
| 147 |
* Officially support Python 3.7 - 3.11. |
| 148 |
|
| 149 |
3.1.0 (2024-05-02) |
| 150 |
------------------ |
| 151 |
|
| 152 |
* Officially support Python 3.7 - 3.12 |
| 153 |
|
| 154 |
3.2.0 (2025-04-21) |
| 155 |
------------------ |
| 156 |
|
| 157 |
* Officially support Python 3.13. |
| 158 |
|