Skip to main content

Count lines of code, comments, and blanks by language

Project description

codecount-cli

Count lines of code, comments, and blanks by language. Like cloc but simpler, with --json output for automation.

Install

pip install codecount-cli

Usage

codecount .                    # Count all files in current directory
codecount src/                 # Specific directory
codecount file.py              # Single file
codecount . --top 10           # Top 10 languages
codecount . -l python          # Filter by language
codecount . --json             # JSON output
codecount . --csv              # CSV output
codecount . --by-file          # Per-file breakdown
codecount --languages          # List supported languages

Example Output

----------------------------------------------------
Language               Files     Code  Comment    Blank
----------------------------------------------------
Python                     4      312       45       67
YAML                       2       28        3        8
TOML                       1       18        0        4
Markdown                   1       42        0       12
----------------------------------------------------
Total                      8      400       48       91
----------------------------------------------------

Features

  • 50+ languages detected by file extension
  • Comment detection for Python, JS/TS, C/C++, Java, Go, Rust, Ruby, and more
  • Auto-ignores .git, node_modules, pycache, dist, build, etc.
  • Respects .gitignore when inside a git repo
  • JSON and CSV output for scripting and automation
  • Per-file breakdown with --by-file
  • Zero dependencies beyond Click

License

MIT

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

codecount_cli-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

codecount_cli-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file codecount_cli-0.1.0.tar.gz.

File metadata

  • Download URL: codecount_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for codecount_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6545e6160576934435b76555692b9fa62bec24a6520fb7a8d4a5d1e5a944e947
MD5 3e82c94f027dee8146c870fd49210306
BLAKE2b-256 26ab099201ee0e7abdeae8f1c4ca633c75722f8c4278c17c0c561c6dec6709c3

See more details on using hashes here.

File details

Details for the file codecount_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codecount_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for codecount_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe173f7a278efd5cfaf7c609f695c554142b6b8e9f148861cf3219d4153257e0
MD5 53cbccce53bb1476a28eaa387f607c7d
BLAKE2b-256 4f9d10df85d3d859feb7f61606f3d7f93a2a18b4e413707e450b8b24e65ad87e

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