A blazing-fast, parallel Lines of Code counter with Rich terminal UI
Project description
codelines ๐
A blazing-fast, parallel Lines of Code counter with a beautiful terminal UI.
Count lines of actual code in any project โ respects .gitignore and .ignore files, uses multi-threaded parallel counting, and displays results in rich, interactive tables.
Features
- โก Parallel counting โ uses all CPU cores for maximum speed
- ๐จ Rich terminal UI โ live progress bars, spinners, and formatted tables
- ๐ Git-aware โ automatically respects
.gitignoreand.ignorepatterns - ๐ Smart stats โ breakdowns by file extension, directory, and root folder
- ๐ง Flexible output โ table (default), JSON, CSV formats
- ๐ฏ Filtering โ include/exclude specific file extensions
- ๐ Depth control โ limit directory traversal depth
Installation
pip install codelines
Quick Start
# Count lines in current directory
codelines .
# Count lines in a specific directory
codelines ~/my-project
# Output as JSON
codelines . --format json
# Only count Python and JavaScript files
codelines . --include .py .js
# Limit to 3 levels deep
codelines . --max-depth 3
Usage
Usage: codelines [OPTIONS] [DIRECTORY]
Options:
--format [table|json|csv] Output format (default: table)
--include EXT [EXT ...] Only count files with these extensions
--exclude EXT [EXT ...] Skip files with these extensions
--max-depth N Maximum directory depth to traverse
--workers N Number of worker threads (default: CPU count ร 2)
--ignore-file PATH Additional ignore file to use
--detail / --no-detail Show per-file line counts (default: --no-detail)
--sort-by [ext|dir|lines] Sort results by (default: lines)
--top N Show top N results (default: 5)
--version Show version and exit
--help Show this message and exit
Example Output
Summary
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโ
โ Metric โ Value โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโค
โ Total Files (counted) โ 847 โ
โ Total Lines (real code) โ 124,532 โ
โ Workers โ 16 โ
โ Skipped Directories โ 23 โ
โ Skipped Files โ 156 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโ
Top File Types (Actual Code)
โโโโโโโโโโโโโฌโโโโโโโโโโ
โ Extension โ Lines โ
โโโโโโโโโโโโโผโโโโโโโโโโค
โ .py โ 52,341 โ
โ .js โ 28,912 โ
โ .ts โ 18,234 โ
โ .css โ 12,567 โ
โ .html โ 8,901 โ
โโโโโโโโโโโโโดโโโโโโโโโโ
License
MIT ยฉ Muneer Alam
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
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 codelines-0.1.0.tar.gz.
File metadata
- Download URL: codelines-0.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4123c67330a63e5bc3d430f78f808ea2edcd8a144134cf0ec95e6ac16df87cea
|
|
| MD5 |
e643de181de591ad6f03252200bb48fe
|
|
| BLAKE2b-256 |
d6e1c35d75ce297ac13ee61c21ceb71fbf00ffc7c5b721ee5eb54617c718672d
|
File details
Details for the file codelines-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codelines-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497898cb89e2e66e389b8f114e874808720b4bb8c11ac5225395762bb503edd1
|
|
| MD5 |
3d833063839f91a11aae899a6f4433ab
|
|
| BLAKE2b-256 |
b976a6ab2ce8d4fa84a22a5ddbc7a71279163d3a0773d4730818420f3d95940a
|