
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
the Python 2 minifier behind liquen_ almost totally based on minipy_ by Gareth Rees http://garethrees.org/
liquify is a minifier for Python 2 focused on maintaining usability of the minified code as an imported module (which means it preserves functions and variables that could have been of use for external code calling the minified code). For example::
$ cat fib.py
cache = {0: 0, 1: 1, 2: 1, 3: 2}
def fibonacci(n):
"""Return the nth Fibonacci number."""
if n not in cache:
a = n // 2
r = n % 2
m = (r * 2) - 1
cache[n] = fibonacci(a + 1) ** 2 + m * fibonacci(a + r - 1) ** 2
return cache[n]
$ liquify --module --docstrings fib.py
cache={0:0,1:1,2:1,3:2}
def fibonnacci(a):
if a not in b:d=a//2;e=a%2;f=e*2-1;b[a]=fibonnacci(d+1)**2+f*c(d+e-1)**2
return b[a]
::
Usage: liquify [options] [-o OUTPUT] FILE
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-o OUTPUT, --output=OUTPUT
output file (default: stdout)
-D, --docstrings remove docstrings and other statements with no side
effects (implies --noselftest)
-R, --rename aggressively rename non-preserved variables
-i INDENT, --indent=INDENT
number of spaces per indentation level
-p PRESERVE, --preserve=PRESERVE
preserve words from renaming (separate by commas)
-m, --module preserve top level object names (for use as imported
--nojoinlines put each statement on its own line
--noselftest skip the self-test
--debug dump the parse tree
liquify is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
_ for more details.
.. _minipy: https://github.com/gareth-rees/minipy .. _liquen: http://liquen.herokuapp.com/ .. _GNU General Public License: http://www.gnu.org/copyleft/gpl.html
FAQs
Minify Python 2 modules
We found that liquify 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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.