Skip to main content

A tool to detect programming languages in a directory.

Project description

PyPI version License: MIT Downloads

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.

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

LngDetectoR-0.16.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

LngDetectoR-0.16-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file LngDetectoR-0.16.tar.gz.

File metadata

  • Download URL: LngDetectoR-0.16.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for LngDetectoR-0.16.tar.gz
Algorithm Hash digest
SHA256 386ef611c02e80d88c215f6e84fe7e4c51429bff7db2c05db21cbd8a51fde39e
MD5 502557116c1c5223f9c94682752c2a15
BLAKE2b-256 bc9abd01c93941d92f45b0356a5481f67f4fa7606d27a090a754cbe390e879ec

See more details on using hashes here.

File details

Details for the file LngDetectoR-0.16-py3-none-any.whl.

File metadata

  • Download URL: LngDetectoR-0.16-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for LngDetectoR-0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 0c52f881db73b50fa3da00533235981b101a5ccdd0e9abc39f886b34053848fc
MD5 17cf482a8e890fb84cdc2b97c5d78c0a
BLAKE2b-256 a51be2a1095d3a4fd0b5d03318fce9b57730942e31354cdf04f261e6b7b09c52

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page