pyufunc.count_lines_of_code#

pyufunc.count_lines_of_code(package_path, *, ext='*', verbose=False)#

Counts the number of lines of code in a Python package.

Parameters:
  • package_path (str) – The path to the package.

  • ext (str) – The extension of the files to count. Default is “*”.

  • verbose (bool) – Whether to print the file paths being counted. Default is False.

Raises:

Examples

>>> from pyufunc import count_lines_of_code
>>> count_lines_of_code("pyufunc")
>>> 5000
>>> count_lines_of_code("pyufunc", ext="py")
>>> 4500
Returns:

The number of lines of code in the package.

Return type:

int