[Web-SIG] CSS parsers: prior art

Simon Willison cs1spw at bath.ac.uk
Fri Oct 24 23:59:11 EDT 2003

I just had a look around for prior art of libraries that handle CSS 
parsing for languages other than Python.

Perl has a number of interesting modules for handling CSS in CPAN:


This module provides a small, light weight object oriented style API for 
reading and writing CSS files "with as little code as possible". It 
seems like it would map to a nicely Pythonic simple module that makes 
use of operator overloading.

CSS 1.05

This is	a large, object oriented library that appears to provide access 
to a variety of alternative parsers and formatters. The basic principle 
involves converting CSS declarations in to an object tree.


This is an event based CSS parser modelled on the W3C's Simple API for 
CSS: http://www.w3.org/TR/SAC/

Also of interest is the W3C's DOM specification for styling:


It seems we are spoilt for choice when it comes to picking an API to 
base a Python CSS module on.

Simon Willison
Web development weblog: http://simon.incutio.com/

More information about the Web-SIG mailing list