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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a2f81a97411daf1698d838853d6cfd6c92ce78d81e3233edbd72182c0a1dc9 |
|
MD5 | 6b7e5d092023294335c769c64d30a15d |
|
BLAKE2b-256 | e15be042f8c3c93a84620f210af408dd992c01b4de88e038cdc50108d6791214 |