Skip to main content

Just like nix command cat or tail, it continuously scan a file line by line.

Project description

k3cat

Action-CI Build Status 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.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

k3cat-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: k3cat-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for k3cat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ac63ee8f7f052e6eaf82565e224b321afc45b4c7cf9fe3464f498917b79a2ac
MD5 9e340f8da7c3856b6a88e7cedaf1b45d
BLAKE2b-256 17e768ac65530e080a048e4434407da91032eb8d2e5e8632b994121d0892083e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: k3cat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for k3cat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7e63939c613b4c6c4432eef650a97e59cfc29fe2acd68e6ad7be54e23b1969
MD5 f56872ea58ffa9ffabb485f7e1df5fd9
BLAKE2b-256 139552034f5b9801b2280e06ed9d75a277475f3da0dba868cc1411b0e84e8e94

See more details on using hashes here.

Supported by

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