Skip to main content

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


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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

guesslang-0.9.0rc5-py3.5.egg (3.2 MB view details)

Uploaded Egg

guesslang-0.9.0rc5-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file guesslang-0.9.0rc5.tar.gz.

File metadata

  • Download URL: guesslang-0.9.0rc5.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for guesslang-0.9.0rc5.tar.gz
Algorithm Hash digest
SHA256 6e0ce3b00db53fa8152c882e21d3aacfe169aeb71e0887d020238ae4e2ab30b9
MD5 fcec21970c0d58141e7e1ed937aa0e42
BLAKE2b-256 4d460d74ce4c4efb297893b631cc87ae07709a2259cec6c5268668d66ea31ee0

See more details on using hashes here.

File details

Details for the file guesslang-0.9.0rc5-py3.5.egg.

File metadata

File hashes

Hashes for guesslang-0.9.0rc5-py3.5.egg
Algorithm Hash digest
SHA256 14d3499df42c067bd64cb898e60df815520b704867b721641a0e4c3a4bd966f8
MD5 30f789cd9f2eca2216ec35f9545e6dd8
BLAKE2b-256 f07c00af2d6fab3dfc447630cd37441a5280d0ca6e5bd91ed6e7085a30ec4859

See more details on using hashes here.

File details

Details for the file guesslang-0.9.0rc5-py3-none-any.whl.

File metadata

File hashes

Hashes for guesslang-0.9.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 a27657e79477589eb191eaec336fa4da4d533221df59425e9688b514417f0394
MD5 d1dd50fd02e54d75e6ba30959c926929
BLAKE2b-256 022e8ec385872dbc456d26b6b10c5a2e04be142576236e9dc1a03d8b1a19093a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page