A tool to detect programming languages in a directory.
Project description
LngDetectoR
LngDetectoR is a Python tool designed to analyze directories and detect the programming languages used in the files. It provides a comprehensive report including the count of files, lines of code, and the percentage of each language present.
Installation
To install LngDetectoR, you can use pip:
pip install LngDetectoR
Usage
As a Command Line Tool
You can use LngDetectoR directly from the command line. The basic usage is as follows:
lngdetector --directory <path-to-directory>
--directory
: Specify the directory you want to analyze. If not specified, it uses the current working directory.
As a Python Module
LngDetectoR can also be used as a Python module in your scripts.
Example:
from lngdetector.main import generate_report
# Generate a report for the current directory
report = generate_report('/path/to/your/project')
# Print the pretty table
report.print_pretty_table()
# Get data for a specific language
python_data = report.get_language_data('Python')
print(f"Python files: {python_data['count']}, lines of code: {python_data['lines']}")
Output Example
When you run LngDetectoR, it outputs a table with the detected languages, the count of files, lines of code, and the percentage. Here is an example output:
Total files: 50
Total lines of code: 1200
+------------+------------+---------------+------------+
| Language | File Count | Lines of Code | Percentage |
+------------+------------+---------------+------------+
| Python | 20 | 500 | 41.67% |
| JavaScript | 15 | 350 | 29.17% |
| HTML | 10 | 200 | 16.67% |
| CSS | 5 | 150 | 12.50% |
+------------+------------+---------------+------------+
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page. Make sure to follow the code of conduct of this project.
License
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
Built Distribution
Hashes for LngDetectoR-0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ee6d31e84e2b05873ae9a4d7a2d58e6bb37c3a1da97cab495ffb666c12a21e2 |
|
MD5 | 2b5f3a37018d8f9acffbb25e2fd04c8e |
|
BLAKE2b-256 | 0642439ae132733dd0363cc2c642a4b0a6b117851e60e7bc1c00879ea7e26498 |