Detect the programming language of a source code
Project description
Guesslang detects the programming language of a given source code:
from guesslang import Guess
name = 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(name) # >>> Erlang
Guesslang supports 20 programming languages:
C |
C# |
C++ |
CSS |
Erlang |
Go |
HTML |
Java |
Javascript |
Markdown |
Objective-C |
PHP |
Perl |
Python |
Ruby |
Rust |
SQL |
Scala |
Shell |
Swift |
The current guessing accuracy is higher than 90%.
You can contribute to Guesslang on Github https://github.com/yoeo/guesslang.
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
guesslang-0.9.1.tar.gz
(3.1 MB
view hashes)
Built Distributions
guesslang-0.9.1-py3.5.egg
(3.2 MB
view hashes)
Close
Hashes for guesslang-0.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb201615d1e8a4bff8dff7bf00fc40d7e2a65a064dd24ea78041cb20bd110605 |
|
MD5 | 628b8c2c2d72d64b1fbbad14170f7ee5 |
|
BLAKE2b-256 | 357d651a5e5775faedf4b48d4551100173c3c17d72ea46ca94d9b177109a20e7 |