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

Uploaded Python 3

File details

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

File metadata

  • Download URL: k3cat-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 96b54f1ffa8bd519df3f41e1227c94ab5b640e82ef0e8c5c8841880b81bca582
MD5 4e99f3b6ada4ed65a8f451d7f7703c70
BLAKE2b-256 ce684511f7e67f85fd01dd79446070df6efbc4f994d9a3c50f951147d4d84dba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: k3cat-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63c515b524437e0612eb7b0c74af2ca114dfa961ffb556b9b47ce30894628a6b
MD5 db08bd1e438c22fc6d224b90b3ed04af
BLAKE2b-256 d1598f2a051eaab4d55898ddcc5529552ce19f644f202b36688d28b2c1b55e18

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