A Python scripts that converts css to json. I usually use this when I do web scrapping and I need to scrape something from css using classnames or ids.
$ git clone https://github.com/CITGuru/cssjson.git
$ cd cssjson
$ python setup.py install$ pip install cssjsonfrom cssjson import toJSON, toCSS
json = toJSON("example.css", path=True)
print(json)
css = toCSS(json)
print(css)Converts css to json and can either be a text, file or url.
print(toJSON(".a{background:yellow}")print(toJSON("example.css", path=True)print(toJSON("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css", url=True)Converts json serialized css to css.
print(toCSS({"rules":{}}))You can contribute by sending a PR.
Oyetoke Toby (oyetoketoby80@gmail.com)