Skip to main content

Like nix command cat or tail, continuously scan a file line by line

Project description

k3cat

Action-CI Documentation Status Package

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

k3cat-0.1.3.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k3cat-0.1.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for k3cat-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1191bb386a6296cc2d3d87427b3b5066f866a25e7a1d32ac1be13e48ed1be534
MD5 5064fc386c26bd6d91f75c3bd68d6982
BLAKE2b-256 67d9113b567afccf4b9f812590694c4e778b1d2fd84b918596efa9e8fea9423b

See more details on using hashes here.

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

Hashes for k3cat-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1249b6ae51821386a37f8912e79ed8f1387ddc8a73bd223bf2c9640590e63c3
MD5 7ff0b163c536e709206d053af519e9d4
BLAKE2b-256 09afede20ef93e0e0876a699196d9301d26f55108a0b6b3c644d7054f02d805a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page