Detect the programming language of a source code
Project description
Guesslang detects the programming language of a given source code. It supports more than 50 programming languages and detects the correct programming language with more than 90% accuracy.
Guesslang is an open source deep learning software that have been trained with over a million source code files.
You can use Guesslang as a command line interface tool or as a Python module:
from guesslang import Guess
guess = Guess()
# Guess the language from code
language = guess.language_name("""
% Quick sort
-module (recursion).
-export ([qsort/1]).
qsort([]) -> [];
qsort([Pivot|T]) ->
qsort([X || X <- T, X < Pivot])
++ [Pivot] ++
qsort([X || X <- T, X >= Pivot]).
""")
print(language) # --> Erlang
Guesslang supports 54 of the world’s most popular programming languages:
Assembly |
Batchfile |
C |
C# |
C++ |
Clojure |
CMake |
COBOL |
CoffeeScript |
CSS |
CSV |
Dart |
DM |
Dockerfile |
Elixir |
Erlang |
Fortran |
Go |
Groovy |
Haskell |
HTML |
INI |
Java |
JavaScript |
JSON |
Julia |
Kotlin |
Lisp |
Lua |
Makefile |
Markdown |
Matlab |
Objective-C |
OCaml |
Pascal |
Perl |
PHP |
PowerShell |
Prolog |
Python |
R |
Ruby |
Rust |
Scala |
Shell |
SQL |
Swift |
TeX |
TOML |
TypeScript |
Verilog |
Visual Basic |
XML |
YAML |
Full documentation at https://guesslang.readthedocs.io/en/latest/
Project details
Release history Release notifications | RSS feed
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 guesslang-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48866a4e7de9148d25e49db6f6fe51504b76b900eb613e0cb9759502fc25ada6 |
|
MD5 | 48a7a6f66b28222bebf10c54d5761d82 |
|
BLAKE2b-256 | 18d78d902853308486126b2ce0cba4659a580ce06d4a9ee6eefb919066150591 |