Cython is able to do this. This is a Pyrex semi-projector, and it can wrap existing data structures and provide them to Python. In fact, this is one of the sections in the user guide . Cython is relatively easy to use and includes an HTML output format that displays all the generated code, as well as highlighted “hot spots” where optimization can be applied.