Like nix command cat or tail, continuously scan a file line by line
Project description
k3cat
Just like nix command cat or tail, it continuously scan a file line by line.
k3cat is a component of pykit3 project: a python3 toolkit set.
Just like nix command cat or tail, it continuously scan a file line by line.
It provides with two way for user to handle lines: as a generator or specifying a handler function.
It also remembers the offset of the last scanning in a file in /tmp/.
If a file does not change(inode number does not change), it scans from the last
offset, or it scan from the first byte.
Install
pip install k3cat
Synopsis
import sys
import k3cat
fn = sys.argv[1]
for x in k3cat.Cat(fn, strip=True).iterate(timeout=0):
print(x)
Author
Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Copyright and License
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file k3cat-0.1.3.tar.gz.
File metadata
- Download URL: k3cat-0.1.3.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1191bb386a6296cc2d3d87427b3b5066f866a25e7a1d32ac1be13e48ed1be534
|
|
| MD5 |
5064fc386c26bd6d91f75c3bd68d6982
|
|
| BLAKE2b-256 |
67d9113b567afccf4b9f812590694c4e778b1d2fd84b918596efa9e8fea9423b
|
File details
Details for the file k3cat-0.1.3-py3-none-any.whl.
File metadata
- Download URL: k3cat-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1249b6ae51821386a37f8912e79ed8f1387ddc8a73bd223bf2c9640590e63c3
|
|
| MD5 |
7ff0b163c536e709206d053af519e9d4
|
|
| BLAKE2b-256 |
09afede20ef93e0e0876a699196d9301d26f55108a0b6b3c644d7054f02d805a
|