{"id":13611567,"url":"https://github.com/yoeo/guesslang","last_synced_at":"2026-02-05T21:08:31.851Z","repository":{"id":37561858,"uuid":"91983511","full_name":"yoeo/guesslang","owner":"yoeo","description":"Detect the programming language of a source code","archived":false,"fork":false,"pushed_at":"2024-03-04T07:12:36.000Z","size":44749,"stargazers_count":876,"open_issues_count":33,"forks_count":127,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-29T12:18:02.752Z","etag":null,"topics":["classification","deep-learning","deep-neural-networks","machine-learning","programming-language","python","tensorflow"],"latest_commit_sha":null,"homepage":"https://guesslang.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-21T19:55:28.000Z","updated_at":"2025-11-23T17:35:45.000Z","dependencies_parsed_at":"2024-06-18T15:28:14.302Z","dependency_job_id":"3403c097-3e9d-44a4-a59b-6081aa89e017","html_url":"https://github.com/yoeo/guesslang","commit_stats":{"total_commits":128,"total_committers":4,"mean_commits":32.0,"dds":0.0390625,"last_synced_commit":"42ec63776777e1bdce2d72f51710c6634e36e00c"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/yoeo/guesslang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoeo%2Fguesslang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoeo%2Fguesslang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoeo%2Fguesslang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoeo%2Fguesslang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoeo","download_url":"https://codeload.github.com/yoeo/guesslang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoeo%2Fguesslang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29134429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T20:50:26.975Z","status":"ssl_error","status_checked_at":"2026-02-05T20:49:26.082Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","deep-learning","deep-neural-networks","machine-learning","programming-language","python","tensorflow"],"created_at":"2024-08-01T19:01:57.895Z","updated_at":"2026-02-05T21:08:31.826Z","avatar_url":"https://github.com/yoeo.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Guesslang [![Build Status](https://github.com/yoeo/guesslang/actions/workflows/python-package.yml/badge.svg)](https://github.com/yoeo/guesslang/actions) [![Documentation Status](https://readthedocs.org/projects/guesslang/badge/?version=latest)](http://guesslang.readthedocs.io/en/latest/?badge=latest) [![Pypi version](https://img.shields.io/pypi/v/guesslang.svg)](https://pypi.python.org/pypi/guesslang)\n\n![Guesslang](docs/_static/images/guesslang-readme.png)\n\nGuesslang detects the programming language of a given source code:\n\n```bash\necho '\npackage main\nimport \"fmt\"\n\nfunc main() {\n    fmt.Println(\"My mascot is a gopher and Google loves me. Who am I?\")\n}\n\n' | guesslang\n\n# ⟶ Programming language: Go\n```\n\nGuesslang supports `54 programming languages`:\n\n| Languages  |                |               |                |              |\n|------------|----------------|---------------|----------------|--------------|\n| `Assembly` | `Batchfile`    | `C`           | `C#`           | `C++`        |\n| `Clojure`  | `CMake`        | `COBOL`       | `CoffeeScript` | `CSS`        |\n| `CSV`      | `Dart`         | `DM`          | `Dockerfile`   | `Elixir`     |\n| `Erlang`   | `Fortran`      | `Go`          | `Groovy`       | `Haskell`    |\n| `HTML`     | `INI`          | `Java`        | `JavaScript`   | `JSON`       |\n| `Julia`    | `Kotlin`       | `Lisp`        | `Lua`          | `Makefile`   |\n| `Markdown` | `Matlab`       | `Objective-C` | `OCaml`        | `Pascal`     |\n| `Perl`     | `PHP`          | `PowerShell`  | `Prolog`       | `Python`     |\n| `R`        | `Ruby`         | `Rust`        | `Scala`        | `Shell`      |\n| `SQL`      | `Swift`        | `TeX`         | `TOML`         | `TypeScript` |\n| `Verilog`  | `Visual Basic` | `XML`         | `YAML`         |              |\n\nWith a guessing **accuracy higher than 90%**.\n\n## Apps powered by Guesslang\n\n#### Microsoft Visual Studio Code, automatic language detection\n\n[Visual Studio Code](https://code.visualstudio.com/)\ndetects the programming language of the source code\nthat you paste into the editor\n[using Guesslang machine learning model](https://code.visualstudio.com/updates/v1_60#_automatic-language-detection).\n\n![](docs/_static/images/vscode.gif)\n\n#### Chameledit\n\n[Chameledit](https://github.com/yoeo/chameledit) is a simple web-editor\nthat automatically highlights your code.\n\n![](docs/_static/images/chameledit.gif)\n\n##### Other projects...\n\n* [Pasta](https://github.com/yoeo/pasta), the [Slack](https://slack.com)\n  bot that pretty-pastes source code.\n* [GG](https://github.com/yoeo/gg), a silly guessing game.\n\n## Documentation\n\n* Guesslang documentation is available at\n  https://guesslang.readthedocs.io/en/latest/\n\n* Guesslang language detection explained here\n  https://guesslang.readthedocs.io/en/latest/contents.html#how-does-guesslang-guess\n\n* Guesslang is based on [Tensorflow](https://github.com/tensorflow/tensorflow)\n  machine learning framework\n\n## Installation\n\n* Python 3.7+ is required\n\n* Install the latest stable version:\n\n```bash\npip3 install guesslang\n```\n\n* or install Guesslang from source code:\n\n```bash\npip3 install .\n```\n\n* Windows specific\n\nTo run [Tensorflow](https://github.com/tensorflow/tensorflow)\non Microsoft Windows you need to install Visual C++ runtime libraries,\navailable on [Microsoft website](https://www.microsoft.com/en-us/download/details.aspx?id=53587)\n\n## Guesslang command line\n\n* Show all available options\n\n```bash\nguesslang --help\n```\n\n* Detect the programming language of ``/etc/bashrc`` configuration file:\n\n```bash\nguesslang /etc/bashrc\n\n# ⟶ Programming language: Shell\n```\n\n* Detect the programming language of a given text:\n\n```bash\necho '\n/** Turn command line arguments to uppercase */\nobject Main {\n  def main(args: Array[String]) {\n    val res = for (a \u003c- args) yield a.toUpperCase\n    println(\"Arguments: \" + res.toString)\n  }\n}\n' | guesslang\n\n# ⟶ Programming language: Scala\n```\n\n* Show the detection probabilities for a given source code:\n\n```bash\necho \"\ndef qsort(items):\n    if not items:\n        return []\n    else:\n        pivot = items[0]\n        less = [x for x in items if x \u003c  pivot]\n        more = [x for x in items[1:] if x \u003e= pivot]\n        return qsort(less) + [pivot] + qsort(more)\n\n\nif __name__ == '__main__':\n    items = [1, 4, 2, 7, 9, 3]\n    print(f'Sorted: {qsort(items)}')\n\n\" | guesslang --probabilities\n\n# Language name       Probability\n#  Python               74.80%\n#  Haskell               6.73%\n#  CoffeeScript          5.32%\n#  Groovy                1.95%\n#  Markdown              0.93%\n#  ...\n```\n\n## Guesslang Python package\n\n* Guesslang can be used as a Python package.\n  [Package documentation available here](https://guesslang.readthedocs.io/en/latest/guesslang.html)\n\n``` python\n\nfrom guesslang import Guess\n\n\nguess = Guess()\n\nname = guess.language_name(\"\"\"\n    % Quick sort\n\n    -module (recursion).\n    -export ([qsort/1]).\n\n    qsort([]) -\u003e [];\n    qsort([Pivot|T]) -\u003e\n          qsort([X || X \u003c- T, X \u003c Pivot])\n          ++ [Pivot] ++\n          qsort([X || X \u003c- T, X \u003e= Pivot]).\n\"\"\")\n\nprint(name)  # ⟶ Erlang\n```\n\n## License and credits\n\n* [Guesslang documentation](https://guesslang.readthedocs.io/en/latest/)\n\n* Gesslang training dataset created with\n  [GuesslangTools](https://github.com/yoeo/guesslangtools)\n\n* Guesslang developped with [Tensorflow](https://www.tensorflow.org/)\n\n* Guesslang icon created with\n  [AndroidAssetStudio](https://github.com/romannurik/AndroidAssetStudio)\n  and\n  [Eduardo Tunni's Warnes font](https://fonts.google.com/specimen/Warnes)\n\n* Example source codes used here retrieved from\n  [Rosetta Code](https://rosettacode.org/wiki/Sorting_algorithms/Quicksort)\n\n* Guesslang — Copyright (c) 2021 Y. SOMDA, [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoeo%2Fguesslang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoeo%2Fguesslang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoeo%2Fguesslang/lists"}