hi @charlesh,
sweet, you could implement a UI in your script, that would make the process even more user friendly. One advice, if you want to distribute your script within your organization, use as much as possible builtin nodes, that will spare you the headache of node library distribution and deployment
as for the purge, I have just tested the purge from #orchid package after reading Purge Unused using Python and it works like a charm _ thanks @erfajo