Metadata-Version: 2.4
Name: k3cat
Version: 0.1.3
Summary: Like nix command cat or tail, continuously scan a file line by line
Author-email: Zhang Yanpo <drdr.xp@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/pykit3/k3cat
Project-URL: Documentation, https://k3cat.readthedocs.io
Keywords: cat,tail,file,scan,pykit3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: k3confloader
Requires-Dist: k3portlock
Requires-Dist: k3utfjson
Requires-Dist: k3fs
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: k3proc; extra == "dev"
Requires-Dist: k3thread; extra == "dev"
Requires-Dist: k3ut; extra == "dev"
Provides-Extra: publish
Requires-Dist: build; extra == "publish"
Requires-Dist: twine; extra == "publish"
Requires-Dist: pk3; extra == "publish"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5; extra == "docs"
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
Dynamic: license-file

# k3cat

[![Action-CI](https://github.com/pykit3/k3cat/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3cat/actions/workflows/python-package.yml)
[![Documentation Status](https://readthedocs.org/projects/k3cat/badge/?version=stable)](https://k3cat.readthedocs.io/en/stable/?badge=stable)
[![Package](https://img.shields.io/pypi/pyversions/k3cat)](https://pypi.org/project/k3cat)

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

```python

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>


[pykit3]: https://github.com/pykit3
