[Python-ideas] Graph class

Vinay Sajip vinay_sajip at yahoo.co.uk
Sun Dec 16 16:36:26 CET 2012


Mark Adam <dreamingforward at ...> writes:

> But your issue of proposing an actual implementation is well-taken
> rather than spend a lot of time arguing over it all.  With any luck,
> I'll try to distill networkx with my work and put it all together.

In terms of use cases, you might be interested in potential users of any stdlib
graph library. I'm working on distlib [1], which evolved out of distutils2 and
uses graphs in a couple of places:

1. A dependency graph for distributions. This came directly from distutils2,
   though I've added a couple of bits to it such as topological sorting and
   determination of strongly-connected components.
2. A lightweight sequencer for build steps, added to avoid the approach in
   distutils/distutils2 which makes it harder than necessary to handle custom
   build steps. I didn't use the graph system used in point 1, as it was too
   specific, and I haven't had time to look at refactoring it.

There's another potential use case in the area of packaging, though perhaps not
in distlib itself: the idea of generating build artifacts based on their
dependencies. Ideally, this would consider not only build artifacts and their
dependencies, but also the builders themselves as part of the graph.

Regards,

Vinay Sajip

[1] https://distlib.readthedocs.org/en/latest/





More information about the Python-ideas mailing list