Is it possible to work with legacy structures

I am currently working with a code that has a directed graph structure: an
object defines `inputs` and `outputs` which return iterables of the objects
with the same interface. Each object has a bunch of useful payload. I am
looking for a python libarary that is capable of handling such data
structure without the conversion to an intermediate format that is loaded
for graph processing algrorithms.

So instead of walking the data structure I have and converting it to a list
of lists or whatever representation is consumed by the graph library, I
would specify an adaptor interface to my own class so the graph library
would be able to interact with my hierarchy directly. Is this sort of thing
possible?

Best regards,
Anton

attachment.html (894 Bytes)

No. Graph-tool has its own internal C++ data structure which is exposed via
Python. However, all algorithms operate on the internal data structure, so
they cannot be used on other ones defined in Python, even if they are
derived from the exposed class.