Skip to main content

A tool for counting lines of code in a project.

Project description

Codetree

Codetree is a Python tool that helps you count the lines of code in your project directory. It supports multiple programming languages and provides a detailed breakdown of the number of lines in your project files. Perfect for analyzing and tracking the size of your codebase in an easy-to-read format.

Features

  • Counts lines of code for a wide variety of programming languages.
  • Skips hidden files and directories (those starting with a .dot).
  • Provides a summary of total lines of code and file count.
  • Supports command-line interface (CLI) for easy integration.

Installation

Using pip

Install Codetree directly from PyPI using pip:

pip install codetree

Manual Installation

To install Codetree manually, clone the repository and use pip:

git clone https://github.com/rezamardaniDev/codetree.git
cd codetree
pip install .

Usage

Use Codetree via the command-line interface (CLI). Run the following command in your terminal:

codetree /path/to/your/project

This scans the specified directory (or current directory by default) and outputs the number of lines of code in each file, plus a summary of total lines.

Example

$ codetree .
Scanning directory: .
|-- src/
|    └── main.py -> 150 lines of code
|    └── utils.py -> 85 lines of code
|
|-- test/
|    └── test_main.py -> 25 lines of code
|
Total files checked: 3
Total lines of code: 260
Total folders: 2

Options

  • Path: Specify the project directory as an argument. If no path is provided, the current directory (.) is used by default.
codetree /path/to/project

Contributing

We welcome contributions to Codetree! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature-name).
  6. Create a new pull request.

If you find a bug or want to add a feature, feel free to open an issue or submit a pull request!

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

codetree_cli-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

codetree_cli-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codetree_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for codetree_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f011a310bbb640ca762a81b9a53a7f61b5d472dbef058187ad9491f20e883a14
MD5 9be2d09433ecc0a7e5e03b6cf7609275
BLAKE2b-256 f0a6f17def76def8d251295ab919d7f8aae6c777d3152d7c7d117fa3e24d7e4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codetree_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for codetree_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb22b4ef5e08f04d9ea195631b67243a35d47341ea7e28b708dab2c47de26e4b
MD5 0deef9fffaa850ea3b7c99836a56efce
BLAKE2b-256 b36dfcf9c9b0b98a56a15f26029282923ff82026941b8d0fc7e21fe87b70cbbb

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