Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
This is a programming language detection library.
It will detect programming language of source in pure python from an ensemble of classifiers. Use this when a quick and dirty first approximation is good enough. whats_that_code can currently identify 60%+ of samples without knowing the extension or tag.
I created this because I wanted
Tested on python 3.6 through 3.9.
from whats_that_code.election import guess_language_all_methods
code = "def yo():\n print('hello')"
result = guess_language_all_methods(code, file_name="yo.py")
assert result == ["python"]
Each is imperfect and can error. The classifier then combines the results of each using a voting algorithm
This works best if you only use it for fallback, e.g. classifying code that can't already be classified by extension or tag, or when tag is ambiguous.
It was a tool that outgrew being a part of so_pip a StackOverflow code extraction tool I wrote.
FAQs
Guess programming language from a string or file.
We found that whats-that-code 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.