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.1.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.1-py3.5.egg (3.2 MB view details)

Uploaded Egg

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

Uploaded Python 3

File details

Details for the file guesslang-0.9.1.tar.gz.

File metadata

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

File hashes

Hashes for guesslang-0.9.1.tar.gz
Algorithm Hash digest
SHA256 c13fcb9bb1d21a869043c0f9839cb16dfd87461b2fa42da6ea0d62ca4ba8caa4
MD5 24d4fa4b0c2255d4c294e742df85075d
BLAKE2b-256 4cfabc8752ed45412c199ff0c9de2bdb91b4ae319e03665b9ea1e29ed3f6a973

See more details on using hashes here.

File details

Details for the file guesslang-0.9.1-py3.5.egg.

File metadata

  • Download URL: guesslang-0.9.1-py3.5.egg
  • Upload date:
  • Size: 3.2 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for guesslang-0.9.1-py3.5.egg
Algorithm Hash digest
SHA256 e85628fbdd40993aa6e073afd56495abd75f1c33b26c649d4e5e31cc492ba40d
MD5 8ad0502ecdb81a6d8bda1f47e36bebce
BLAKE2b-256 969f7af34b37648ba966ef41d13e363c3b29bb186288f8b8c92d1addbfecd1a9

See more details on using hashes here.

File details

Details for the file guesslang-0.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for guesslang-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb201615d1e8a4bff8dff7bf00fc40d7e2a65a064dd24ea78041cb20bd110605
MD5 628b8c2c2d72d64b1fbbad14170f7ee5
BLAKE2b-256 357d651a5e5775faedf4b48d4551100173c3c17d72ea46ca94d9b177109a20e7

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