██████╗███████╗███████╗███╗ ███╗██╗███╗ ██╗██╗███████╗██╗███████╗██████╗ ██╔════╝██╔════╝██╔════╝████╗ ████║██║████╗ ██║██║██╔════╝██║██╔════╝██╔══██╗ ██║ ███████╗███████╗██╔████╔██║██║██╔██╗ ██║██║█████╗ ██║█████╗ ██████╔╝ ██║ ╚════██║╚════██║██║╚██╔╝██║██║██║╚██╗██║██║██╔══╝ ██║██╔══╝ ██╔══██╗ ╚██████╗███████║███████║██║ ╚═╝ ██║██║██║ ╚████║██║██║ ██║███████╗██║ ██║ ╚═════╝╚══════╝╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ------------------------------------------------------------------------------ An open source Python minification package for Cascading Style Sheets (CSS).
To install the package, you should use the PIP package manager:
pip install cssminifier
After that, you can import it into a Python script and use it as you desire. For example:
from cssminifier import Minifier
def main():
with open("tests/media_queries.css", 'r') as fp:
minifier = Minifier(fp.read())
print(minifier())
fp.close()
if __name__ == '__main__':
main()