LngDetectoR
LngDetectoR is a Python tool designed to analyze directories and detect the programming languages used within files. It generates a comprehensive report detailing 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
LngDetectoR can be utilized directly from the command line. Basic usage is as follows:
lngdetector --directory <path-to-directory>
--directory: Specifies the directory to analyze. If not specified, it defaults to the current working directory.
As a Python Module
LngDetectoR can also be used within your Python scripts.
Example:
from lngdetector.detect import generate_report
# Generate a report for the specified directory
report = generate_report('/path/to/your/project')
# Display the report in a pretty table format
report.print_pretty_table()
# Retrieve 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 generates a table with the detected languages, file counts, lines of code, and their percentage contributions. Here's an example of what the output might look like:
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 the issues page for a list of proposed features (and known issues).
License
This project is licensed under the MIT License.
Metadata
Release files for LngDetectoR 2025.5.81751
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lngdetector-2025.5.81751.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lngdetector-2025.5.81751-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / lngdetector-2025.5.81751.tar.gz
| Download URL | lngdetector-2025.5.81751.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50f8b044aa47a2111a611da3222104138e3395af92f34157396aa8d2a61d2258
|
|
BLAKE2b-256 checksum How to use checksums |
d37d54d478739de0acac65bc25901854047aa0cadef53bef6d418b9845c68f65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Release files / lngdetector-2025.5.81751-py3-none-any.whl
| Download URL | lngdetector-2025.5.81751-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cf5288f3578d3e307d1c19680d42371a2c06bda1602e56f000d7915447af1d2
|
|
BLAKE2b-256 checksum How to use checksums |
6088224b20b63a85dee5b9f2a42410b5ef443ad9e984f56bb2a50dce508e4081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|