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.1.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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file k3cat-0.1.1.tar.gz.

File metadata

  • Download URL: k3cat-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 10dfb2364570ccf53fe970020c0fa0f7bd76b80470c336fbf0f7ae8859aedd9a
MD5 2b24be0927c583f11ba9cacf62742a2f
BLAKE2b-256 0307ec7c0352715b8d5f1032bd07a19781bca00c897cffb036dc12373c9e52fd

See more details on using hashes here.

File details

Details for the file k3cat-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: k3cat-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 321fe97fe17b0f2d4bfb302803b1507911debc5e3ce71af30c2b30d5985dff75
MD5 fef1e65e398dbae9d4a56d7a37db2704
BLAKE2b-256 3bf6c006cc8fd6e3a0c13923121ee6a08403fe737e2be5bb4338ee9abed73c2a

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