Package: guesslang-experimental
This isNOT A TYPOSQUATTING PACKAGEIt's a fork of the originalhttps://github.com/yoeo/guesslang/ pypi packageguesslangReason of fork - abandoned project. I need a specific patch. Fixing tensorflow dependency myself untilhttps://github.com/yoeo/guesslang/pull/62is mergedInstall:pip install guesslang-experimentalGuesslangGuesslang detects the programming language of a given source code:echo'package mainimport "fmt"func main() {fmt.Println("My mascot is a gopher and Google loves me. Who am I?")}'|guesslang# ⟶ Programming language: GoGuesslang supports54 programming languages:LanguagesAssemblyBatchfileCC#C++ClojureCMakeCOBOLCoffeeScriptCSSCSVDartDMDockerfileElixirErlangFortranGoGroovyHaskellHTMLINIJavaJavaScriptJSONJuliaKotlinLispLuaMakefileMarkdownMatlabObjective-COCamlPascalPerlPHPPowerShellPrologPythonRRubyRustScalaShellSQLSwiftTeXTOMLTypeScriptVerilogVisual BasicXMLYAMLWith a guessingaccuracy higher than 90%.Apps powered by GuesslangMicrosoft Visual Studio Code, automatic language detectionVisual Studio Codedetects the programming language of the source code
that you paste into the editorusing Guesslang machine learning model.ChameleditChameleditis a simple web-editor
that automatically highlights your code.Other projects...Pasta, theSlackbot that pretty-pastes source code.GG, a silly guessing game.DocumentationGuesslang documentation is available athttps://guesslang.readthedocs.io/en/latest/Guesslang language detection explained herehttps://guesslang.readthedocs.io/en/latest/contents.html#how-does-guesslang-guessGuesslang is based onTensorflowmachine learning frameworkInstallationPython 3.7+ is requiredInstall the latest stable version:pip3installguesslangor install Guesslang from source code:pip3install.Windows specificTo runTensorflowon Microsoft Windows you need to install Visual C++ runtime libraries,
available onMicrosoft websiteGuesslang command lineShow all available optionsguesslang--helpDetect the programming language of/etc/bashrcconfiguration file:guesslang/etc/bashrc# ⟶ Programming language: ShellDetect the programming language of a given text:echo'/** Turn command line arguments to uppercase */object Main {def main(args: Array[String]) {val res = for (a <- args) yield a.toUpperCaseprintln("Arguments: " + res.toString)}}'|guesslang# ⟶ Programming language: ScalaShow the detection probabilities for a given source code:echo"def qsort(items):if not items:return []else:pivot = items[0]less = [x for x in items if x <  pivot]more = [x for x in items[1:] if x >= pivot]return qsort(less) + [pivot] + qsort(more)if __name__ == '__main__':items = [1, 4, 2, 7, 9, 3]print(f'Sorted: {qsort(items)}')"|guesslang--probabilities# Language name       Probability#  Python               74.80%#  Haskell               6.73%#  CoffeeScript          5.32%#  Groovy                1.95%#  Markdown              0.93%#  ...Guesslang Python packageGuesslang can be used as a Python package.Package documentation available herefromguesslangimportGuessguess=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)# ⟶ ErlangLicense and creditsGuesslang documentationGesslang training dataset created withGuesslangToolsGuesslang developped withTensorflowGuesslang icon created withAndroidAssetStudioandEduardo Tunni's Warnes fontExample source codes used here retrieved fromRosetta CodeGuesslang — Copyright (c) 2021 Y. SOMDA,MIT License