Lightweight and optimized implementation of Unix tail utility
Project description
nastya-tail
⚡ Lightweight and optimized implementation of Unix tail utility in Python with Click framework.
Features
- ✅ Output last N lines from files or stdin (default: 10)
- ✅ Byte-based output with
-coption - ✅ Multiple file support with headers
- ✅ Memory-efficient using
dequefor large files - ✅ Optimized file seeking for byte operations
- ✅ Compatible with Unix tail behavior
- ✅ Published on PyPI
Installation
pip install nastya-tail-lnu
Usage
# Last 10 lines (default)
tail file.txt
# Last 20 lines
tail -n 20 file.txt
# Last 100 bytes
tail -c 100 file.txt
# Multiple files with headers
tail file1.txt file2.txt
Command Options
| Option | Description |
|---|---|
-n, --lines N |
Output the last N lines (default: 10) |
-c, --bytes N |
Output the last N bytes |
-v, --verbose |
Always print filename headers |
-q, --quiet |
Never print filename headers |
-h, --help |
Show help message |
Performance
- Uses
collections.dequefor memory efficiency - File seeking for byte operations
- Memory usage: O(n) where n is number of lines to output
- Works efficiently with GB-sized files
📁 Структура директорій
Створіть таку структуру:
nastya-tail/
├── .github/
│ └── workflows/
│ └── pypi-publish.yml
├── nastya_tail/
│ ├── __init__.py
│ └── cli.py
├── .gitignore
├── LICENSE
├── MANIFEST.in
├── pyproject.toml
├── README.md
└── setup.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nastya_tail_lnu-0.1.2.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nastya_tail_lnu-0.1.2.tar.gz.
File metadata
- Download URL: nastya_tail_lnu-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7bbab4d7a5879f0bb2ae02de52f30475cc7dac1834faf6013cd3769cd39bc19
|
|
| MD5 |
89eea2d648f7235aea88f6ddb3fe0f8d
|
|
| BLAKE2b-256 |
a1fc56a4d9e0ab4e668240c973b8fe5dce2185e1daa1eab4c7e15a9c0ec9aeda
|
File details
Details for the file nastya_tail_lnu-0.1.2-py3-none-any.whl.
File metadata
- Download URL: nastya_tail_lnu-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c87a289bbb325ba6a3486c7c87139befe8e19c92ed2824fb4913b5ed6d87c57
|
|
| MD5 |
a79d770fc0fd85e12d54d9bad5a18326
|
|
| BLAKE2b-256 |
1f73bbee8f74d150d000de011028ca73280f84a4259696494cae2c2e96a37d29
|