py-loc is a Python package that counts the lines of code in a given repository. It supports multiple file types and provides options to exclude certain files or directories.
- Count lines of code in various file types.
- Exclude specific files or directories from the count.
- Option to exclude comments and blank lines.
- Generate a summary report.
- Command-line interface for easy usage.
You can install Line Counter using pip:
pip install py-loc
To use Line Counter from the command line, navigate to the root of your repository and run:
py-loc <directory> [options]
<directory>
: The directory to scan for code files.--file-types
: Specify file types to include in the line count (e.g.,.py .js
). Default is.py
.--exclude
: Specify directories or files to exclude from the line count.
Count lines of code in the src
directory, including only Python and JavaScript files, and excluding the tests
directory:
To contribute to the development of Line Counter, follow these steps:
-
Clone the repository:
git clone https://github.com/godwins3/py-loc.git
-
Navigate to the project directory:
cd py-loc
-
Install the dependencies:
pip install -r requirements.txt
-
Run the tests:
pytest
Contributions are welcome! Please read the CONTRIBUTING.md for guidelines on how to contribute to this project.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please open an issue on GitHub or contact me at praisegodwins4@gmail.com.