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.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9812d1208540a114b9ac4e3b45e893b63a87ae436e6987b1ed42f0714ece0958 |
|
MD5 | 1b861990287833c33d7b39fe61d2ad9b |
|
BLAKE2b-256 | d431ac242280a56496bb280ef06c64ceb742a5bd3a9ab72ea6d5500cbe2e5ce5 |