Detect the programming language of a source code
Project description
Guesslang detects the programming language of a given source code.
It supports 30 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 30 of the most popular programming languages:
Batchfile |
C |
C# |
C++ |
CSS |
CoffeeScript |
Erlang |
Go |
HTML |
Haskell |
Java |
JavaScript |
Jupyter Notebook |
Lua |
Markdown |
Matlab |
Objective-C |
PHP |
Perl |
PowerShell |
Python |
R |
Ruby |
Rust |
SQL |
Scala |
Shell |
Swift |
TeX |
TypeScript |
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.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c573ec9da4f56b5713e8e49dd0c1193ab1832a433dcc2b25bbf518812582c6fa |
|
MD5 | 20b02419f972508a35ebefe10d3c49b6 |
|
BLAKE2b-256 | 08c8d93301380c552c9159084078bfd86a2880168a9dbdae5bb586bfb5706185 |