Skip to main content

Python wrapper for the cloc CLI tool

Project description

pycloc

pycloc logo

License Documentation GitHub release PyPI

Python wrapper for the cloc (Count Lines of Code) command-line tool. This library provides a convenient, Pythonic interface to the powerful static analysis tool, enabling you to count lines of code directly from your Python applications with comprehensive error handling and dynamic configuration.

[!WARNING] This library is currently in Alpha. APIs and core features may change without notice based on community feedback and requests. Documentation may be incomplete or outdated, and you should expect bugs and missing functionalities.

Key Features

  • Platform Agnostic: Can run on any operating system out: macOS, Linux and Windows;
  • Zero Dependencies: No third-party Python dependencies, only requiring the Perl interpreter;
  • Dynamic Configuration: Set CLI tool flags as Python attributes with automatic conversion;
  • Comprehensive Error Handling: Custom exception hierarchy for different error scenarios;
  • Type Safety: Full type annotations for better IDE support and code quality.

Requirements

  • Python: 3.10+
  • Perl: 5.6.1+ (required for cloc execution)

[!NOTE] Since cloc is written in Perl, you must ensure that the interpreter is installed and available in your system's PATH. This should work out of the box on most Unix-like systems, but may require additional setup on minimalistic Linux distros or Windows.

License

The Python source code in this project is licensed under the MIT License.

[!IMPORTANT] This project bundles the cloc command-line program, which is a separate work licensed under the GNU General Public License version 2.0 (GPL-2.0). cloc is not part of this project’s source code and remains licensed under GPL-2.0. See THIRD_PARTY_LICENSES.md and LICENSE-GPL-2.0 for details.

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

pycloc-0.0.2a0.tar.gz (325.0 kB view details)

Uploaded Source

Built Distribution

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

pycloc-0.0.2a0-py3-none-any.whl (164.9 kB view details)

Uploaded Python 3

File details

Details for the file pycloc-0.0.2a0.tar.gz.

File metadata

  • Download URL: pycloc-0.0.2a0.tar.gz
  • Upload date:
  • Size: 325.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycloc-0.0.2a0.tar.gz
Algorithm Hash digest
SHA256 c4b5315bbaf5c4dbbcbce4845f0ecb4040a190248deb691083af4970b754cee8
MD5 b675047d76112bc2182e850c6c34371e
BLAKE2b-256 fb1c993722be5de65c85a0da2afe657af25d83375cc59fb7babf5a488cad59a0

See more details on using hashes here.

File details

Details for the file pycloc-0.0.2a0-py3-none-any.whl.

File metadata

  • Download URL: pycloc-0.0.2a0-py3-none-any.whl
  • Upload date:
  • Size: 164.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycloc-0.0.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed52f0427bda98fdf01a2e9d7250db97617bf1a5f6240aa9ac6423bbaaa53cf8
MD5 be31e87903bc1ce69bc3b9e1cf1ce5ff
BLAKE2b-256 77d9d16232be4fedcb5df23fa5d985587d28b8747f4397078733605ac8b40e00

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