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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32dc2c5c9523831138370e706ff52c9be497156e60004678890b5e3b16412a72 |
|
MD5 | ed14983652b683ffeb0875a6c60cba4b |
|
BLAKE2b-256 | 1cd3369d13611fb26eeb2b79098398705d22781e5ead7e9883e418ef41426d03 |