LngDetectoR


NameLngDetectoR JSON
Version 0.15 PyPI version JSON
download
home_pagehttps://github.com/chigwell/langdetector
SummaryA tool to detect programming languages in a directory.
upload_time2023-12-11 09:37:09
maintainer
docs_urlNone
authorEvgenii Evstafev
requires_python
license
keywords language detection programming report
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/LngDetectoR.svg)](https://badge.fury.io/py/LngDetectoR)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/lngdetector)](https://pepy.tech/project/lngdetector)

# 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:

```bash
pip install LngDetectoR
```

## Usage

### As a Command Line Tool

You can use LngDetectoR directly from the command line. The basic usage is as follows:

```bash
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:

```python
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](https://github.com/chigwell/langdetector/issues).

## License

[MIT](https://choosealicense.com/licenses/mit/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/chigwell/langdetector",
    "name": "LngDetectoR",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "language detection programming report",
    "author": "Evgenii Evstafev",
    "author_email": "chigwel@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4d/c6/11fa9e572ac32b07aa0560a2123a16786c8fd1b11da3cef192ebd0fae9ec/LngDetectoR-0.15.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/LngDetectoR.svg)](https://badge.fury.io/py/LngDetectoR)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/lngdetector)](https://pepy.tech/project/lngdetector)\n\n# LngDetectoR\n\nLngDetectoR 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.\n\n## Installation\n\nTo install LngDetectoR, you can use pip:\n\n```bash\npip install LngDetectoR\n```\n\n## Usage\n\n### As a Command Line Tool\n\nYou can use LngDetectoR directly from the command line. The basic usage is as follows:\n\n```bash\nlngdetector --directory <path-to-directory>\n```\n\n- `--directory`: Specify the directory you want to analyze. If not specified, it uses the current working directory.\n\n### As a Python Module\n\nLngDetectoR can also be used as a Python module in your scripts.\n\nExample:\n\n```python\nfrom lngdetector.main import generate_report\n\n# Generate a report for the current directory\nreport = generate_report('/path/to/your/project')\n\n# Print the pretty table\nreport.print_pretty_table()\n\n# Get data for a specific language\npython_data = report.get_language_data('Python')\nprint(f\"Python files: {python_data['count']}, lines of code: {python_data['lines']}\")\n```\n\n## Output Example\n\nWhen 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:\n\n```\nTotal files: 50\nTotal lines of code: 1200\n+------------+------------+---------------+------------+\n|  Language  | File Count | Lines of Code | Percentage |\n+------------+------------+---------------+------------+\n| Python     |     20     |      500      |   41.67%   |\n| JavaScript |     15     |      350      |   29.17%   |\n| HTML       |     10     |      200      |   16.67%   |\n| CSS        |      5     |      150      |   12.50%   |\n+------------+------------+---------------+------------+\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/chigwell/langdetector/issues).\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A tool to detect programming languages in a directory.",
    "version": "0.15",
    "project_urls": {
        "Homepage": "https://github.com/chigwell/langdetector"
    },
    "split_keywords": [
        "language",
        "detection",
        "programming",
        "report"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92aee14f77f6720625739ea3f35c4aa563c3ca81bd41a9827a99c4fcd0864297",
                "md5": "792630af0259e6462dee0f04e983c815",
                "sha256": "bde4461ae024537d1956553ce8663644f221f49c171df8fb075faf114b17220c"
            },
            "downloads": -1,
            "filename": "LngDetectoR-0.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "792630af0259e6462dee0f04e983c815",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4668,
            "upload_time": "2023-12-11T09:37:06",
            "upload_time_iso_8601": "2023-12-11T09:37:06.235526Z",
            "url": "https://files.pythonhosted.org/packages/92/ae/e14f77f6720625739ea3f35c4aa563c3ca81bd41a9827a99c4fcd0864297/LngDetectoR-0.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4dc611fa9e572ac32b07aa0560a2123a16786c8fd1b11da3cef192ebd0fae9ec",
                "md5": "697e96aa390ba3c911c1f140e721f896",
                "sha256": "fd9be7c19d9d258cca6187aaf8adff826dd25fe1411b9f9b003a9fea35c2892e"
            },
            "downloads": -1,
            "filename": "LngDetectoR-0.15.tar.gz",
            "has_sig": false,
            "md5_digest": "697e96aa390ba3c911c1f140e721f896",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4213,
            "upload_time": "2023-12-11T09:37:09",
            "upload_time_iso_8601": "2023-12-11T09:37:09.339272Z",
            "url": "https://files.pythonhosted.org/packages/4d/c6/11fa9e572ac32b07aa0560a2123a16786c8fd1b11da3cef192ebd0fae9ec/LngDetectoR-0.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-11 09:37:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "chigwell",
    "github_project": "langdetector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lngdetector"
}
        
Elapsed time: 0.15348s