Parser for C-style config file?

There are many parsers available for XML files. However, does anyone know of tools for parsing ConfD C-style configuration files?

Any tools or libraries (for any language) would be acceptable, but I am primarily looking for a Python module. The software should be preferably have a liberal license and not GPL. Thank you.

I think you need to search for such library. I suggest you search for general CLI parsing library,m that can be adapted to ConfD C-style. E.g. with keyword “python parse cli output”.

Some results:


Thank you for the pointers. I am looking into these tools.

This is a long shot, but do you know if there is a way to tell ConfD itself to perform an arbitrary operation on the contents of specific nodes (as dictated by their xpaths) before exporting the config? Basically, all I am trying to do is perform a translation on the contents of certain xpaths in the config. But I cannot make the changes in-place in the running configuration. The changes can only appear in the C-style exported config text file.

It sounds to me that you might be looking for transforms - see the chapter “Transformations, Hooks, Hidden Data and Symlinks” of the user guide.

1 Like