Skip to main content

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 -c option
  • ✅ Multiple file support with headers
  • ✅ Memory-efficient using deque for 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.deque for 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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nastya_tail_lnu-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for nastya_tail_lnu-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c7bbab4d7a5879f0bb2ae02de52f30475cc7dac1834faf6013cd3769cd39bc19
MD5 89eea2d648f7235aea88f6ddb3fe0f8d
BLAKE2b-256 a1fc56a4d9e0ab4e668240c973b8fe5dce2185e1daa1eab4c7e15a9c0ec9aeda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nastya_tail_lnu-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c87a289bbb325ba6a3486c7c87139befe8e19c92ed2824fb4913b5ed6d87c57
MD5 a79d770fc0fd85e12d54d9bad5a18326
BLAKE2b-256 1f73bbee8f74d150d000de011028ca73280f84a4259696494cae2c2e96a37d29

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