DAXFi is a Python package that helps configure several different kinds of firewalls in a consistent way. The rules are described in XML. It comes with a Python package, useful to build other applications and includes some useful example programs.
PacketFlow is a command line utility that processes an XML configuration to generate a set of firewall rules. It is intended to be installed and run directly on the firewall itself. PacketFlow was designed to deal with complex configurations.