Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
.. image:: https://img.shields.io/badge/github-source%20code-blue?logo=github&logoColor=white :alt: View on Github :target: https://github.com/yoeo/guesslang/ .. image:: https://img.shields.io/pypi/v/guesslang.svg :target: https://pypi.python.org/pypi/guesslang :alt: Pypi Version .. image:: https://img.shields.io/pypi/l/guesslang.svg :target: https://pypi.python.org/pypi/guesslang/ :alt: License
Guesslang detects the programming language of a given source code. It supports more than 50 programming languages and detects the correct programming language with more than 90% accuracy.
Guesslang is an open source <https://github.com/yoeo/guesslang>
_
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:
.. code-block:: python
from guesslang import Guess
guess = Guess()
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 54 of the world's most popular programming languages:
+-----------+---------------+--------------+---------------+-------------+ | Assembly | Batchfile | C | C# | C++ | +-----------+---------------+--------------+---------------+-------------+ | Clojure | CMake | COBOL | CoffeeScript | CSS | +-----------+---------------+--------------+---------------+-------------+ | CSV | Dart | DM | Dockerfile | Elixir | +-----------+---------------+--------------+---------------+-------------+ | Erlang | Fortran | Go | Groovy | Haskell | +-----------+---------------+--------------+---------------+-------------+ | HTML | INI | Java | JavaScript | JSON | +-----------+---------------+--------------+---------------+-------------+ | Julia | Kotlin | Lisp | Lua | Makefile | +-----------+---------------+--------------+---------------+-------------+ | Markdown | Matlab | Objective-C | OCaml | Pascal | +-----------+---------------+--------------+---------------+-------------+ | Perl | PHP | PowerShell | Prolog | Python | +-----------+---------------+--------------+---------------+-------------+ | R | Ruby | Rust | Scala | Shell | +-----------+---------------+--------------+---------------+-------------+ | SQL | Swift | TeX | TOML | TypeScript | +-----------+---------------+--------------+---------------+-------------+ | Verilog | Visual Basic | XML | YAML | | +-----------+---------------+--------------+---------------+-------------+
Full documentation at https://guesslang.readthedocs.io/en/latest/
FAQs
Detect the programming language of a source code
We found that guesslang demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.