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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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