I have been working on getting something like this to work for a long time so thought that I would share with the community, in case someone else wants to use some of what I have so far. What we needed to do for electrical analysis is trace out a feeder and generate a list of sections on this feeder with upstream and downstream features. Use as you wish. This prints out a connectivity list. There has been alot of trial and error so some things may be a little confusing, but you can get ideas for your own data.
Attached is the code that I used