Skip to main content

A simple command-line tool to count lines in files by extension,

Project description

Here’s a clean and informative README.md for your package extliner:


📦 extliner

extliner is a lightweight Python package that counts lines in files (with and without empty lines) grouped by file extension — perfect for analyzing codebases or text-heavy directories.


🚀 Features

  • 📂 Recursive directory traversal

  • 🔍 Counts:

    • Total lines with whitespace
    • Total lines excluding empty lines
  • 🎯 Extension-based grouping (.py, .txt, NO_EXT, etc.)

  • 🚫 Option to ignore specific file extensions

  • 📊 Beautiful tabulated output

  • 🧩 Easily extensible class-based design

  • 🧪 CLI support


📥 Installation

pip install extliner

(Or if using locally during development:)

git clone https://github.com/extliner/extliner.git
cd extliner
pip install -e .

🧑‍💻 Usage

✅ CLI

extliner -d <directory_path> --ignore .log .json

Example

extliner -d ./myproject --ignore .md .log

Output

+------------+---------------+-------------------+--------------+
| Extension  | With Spaces   | Without Spaces    | % of Total   |
+------------+---------------+-------------------+--------------+
| .py        | 320           | 280               | 65.31%       |
| .txt       | 170           | 150               | 34.69%       |
+------------+---------------+-------------------+--------------+

🧱 Python API

from linecountx.main import LineCounter
from pathlib import Path

counter = LineCounter(ignore_extensions=[".log", ".json"])
result = counter.count_lines(Path("./your_directory"))

print(counter.to_json(result))

⚙️ Options

Flag Description Example
-d Directory to scan (required) -d ./src
--ignore File extensions to ignore --ignore .log .md .json

📄 License

MIT License


👨‍💻 Author

Made with ❤️ by Deepak Raj

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

extliner-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

extliner-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file extliner-0.0.1.tar.gz.

File metadata

  • Download URL: extliner-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for extliner-0.0.1.tar.gz
Algorithm Hash digest
SHA256 516f9b4a91f9095c6f0c907da4b9034618636c3feafec7da4ebe86353a595908
MD5 d2e4bc806417ca2081b80a6900638021
BLAKE2b-256 cd0ccf6b362210d4ab188fa7ca0b049b166705d9d3bf627dd31de35eb7ab5fd3

See more details on using hashes here.

File details

Details for the file extliner-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: extliner-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for extliner-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04015ac9c679502fc18f11742e9ad662e51c1a23dc48bd6f20dcef57b599339d
MD5 1aa9739502097f817ec9012d8c5255e9
BLAKE2b-256 5df82113ae4d25f550364abf92372d480b0a24540bb1c6af787e2fb625363027

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