Install & Compatibility
Where this runs
tested against v0.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Tailer
✓ from tailer import Tailer
✗ import tailer
follow
✓ from tailer import follow
✗ import tailer
head
✓ from tailer import head
✗ import tailer
This quickstart demonstrates how to use `tailer.tail` to read the last few lines of a file and `tailer.head` to read the first few lines. It first creates a dummy file, then applies both functions, ensuring to pass an opened file object to them.
import tailer
import os
# Create a dummy log file for demonstration
file_path = 'my_log_file.log'
with open(file_path, 'w') as f:
f.write('Line 1\n')
f.write('Line 2\n')
f.write('Line 3\n')
f.write('Line 4\n')
f.write('Line 5\n')
f.write('Line 6\n')
# Read the last 3 lines using tailer.tail
print(f"Reading last 3 lines of '{file_path}':")
with open(file_path, 'r') as f:
for line in tailer.tail(f, 3):
print(line.strip())
# Read the first 2 lines using tailer.head
print(f"\nReading first 2 lines of '{file_path}':")
with open(file_path, 'r') as f:
for line in tailer.head(f, 2):
print(line.strip())
# Cleanup the dummy file
os.remove(file_path)
Debug
Known issues
gotchaTailer functions (tail, head, follow) expect an *open file object*, not a file path string. Passing a string will result in a TypeError or incorrect behavior.fixAlways pass `open('your_file.log', 'r')` or a file-like object to tailer functions, e.g., `tailer.tail(open('my_file.log', 'r'), 10)`. affects: All versions
gotcha`tailer.follow()` is a blocking generator. It will continuously yield new lines as they are written to the file and will not terminate until the process is stopped or the generator is explicitly broken out of.fixUse `tailer.follow()` in an infinite loop with appropriate `break` conditions or signal handling, or run it in a separate thread/process if your main application needs to continue execution.
affects: All versions
deprecatedThe `tailer` library has not been updated since 2017 (version 0.4.1). While stable for its intended purpose, it may not leverage newer Python features, handle modern asynchronous patterns, or receive security updates.fixFor basic file tailing, it remains functional. For complex, high-performance, or modern asynchronous applications, consider alternative libraries or custom implementations.
affects: 0.4.1 and earlier
Upgrade
Version history
0.4.1latest on PyPI · released Dec 9, 2015
Audit
Dependencies
No dependency data recorded yet.