CSS Minifier Python Example
Check the example on how to use
Python
to minify a CSS hardcoded string and output to stdout:import requests response = requests.post('https://www.toptal.com/developers/cssminifier/api/raw', data=dict(input='p { color : red; }')).text print("{}".format(response))
Install
requests
module, save the code to a file named minify.py
and run the following command:python3 minify.py
Output:
p{color:red}