skillfed

pygount

count source lines of code (SLOC) using pygments

pygount v3.2.0 719.8K downloads/30d#5,238 on PyPI186
Permissive license BSD-3-Clause Active released

What it is and what it does

Pygount is a command-line tool that scans directories or remote git repositories to count source lines of code (SLOC) across any programming language supported by pygments. It works similarly to sloccount and cloc but leverages pygments' language detection to analyze a wide range of file types without needing language-specific parsers.

You run it from the shell to get per-file line counts, language summaries with percentages, or export results in cloc-compatible XML format for integration with CI/CD systems like Jenkins. It can analyze local folders, filter by file suffix, and even check out specific git revisions directly from remote URLs without cloning.

Use it for:

  • Generate SLOC reports for code review or project metrics in CI/CD pipelines.
  • Compare code volume across multiple programming languages in a single repository.
  • Export metrics in cloc XML format for ingestion by Jenkins or other build tools.
  • Analyze remote git repositories directly without downloading the full clone.
  • Filter analysis to specific file types (e.g., only .py and .yml files) for focused metrics.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Pygount counts source lines of code (SLOC) across multiple programming languages by scanning folders or remote git repositories, using pygments for language detection.

Yes. Pygount is a stable, actively maintained tool with low install friction, no known vulnerabilities, and permissive licensing. Install it if you need to measure code volume across multiple languages or integrate SLOC reporting into your build pipeline.

Install

pygount on PyPI

pip

pip install pygount

uv

uv add pygount

poetry

poetry add pygount

Installing pygount

Before you install

Low friction install with a pure Python wheel. Actively maintained with a recent release (128 days ago) and an active repository; supports current Python versions (3.10–3.14).

License in practice

BSD-3-Clause is permissive; you can use, modify, and distribute pygount freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pygount
pygount ~/projects/example
pygount --format=summary ~/projects/example

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — chardet, gitpython, pygments, rich
Maintenance actively maintained — 128 days since the last release
Last repo commit
First released
Downloads 719,788/month — #5,238 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pygount-3.2.0-py3-none-any.whl

Keywords: SLOC, code analysis, count

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development

Tags

count lines of codesource code metricsSLOC analysis toolcode line counterpygments-based code analysisrepository code statisticsmulti-language line counter
code-metricscli-tool

More Software Development packages