csnake

csnake is a Python 3 package that helps You manually generate C code from Python.

Almost everything you can do with csnake can be done ‘by hand’ in Python, but csnake provides You with a consistent API that helps You structure your C-generating Python code.

The killer feature is simple generation of struct and array initializers from Python dicts and lists (actually, Maps and Collections), nested to an arbitrary level.