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.0rc5.tar.gz
(3.1 MB
view hashes)
Built Distributions
guesslang-0.9.0rc5-py3.5.egg
(3.2 MB
view hashes)
Close
Hashes for guesslang-0.9.0rc5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a27657e79477589eb191eaec336fa4da4d533221df59425e9688b514417f0394 |
|
MD5 | d1dd50fd02e54d75e6ba30959c926929 |
|
BLAKE2b-256 | 022e8ec385872dbc456d26b6b10c5a2e04be142576236e9dc1a03d8b1a19093a |