Feel free to check out the website for source code and documenation
https://byuccl.github.io/spydrnet/How to install SpyDrNet
Parsing a preexisting netlist with SpyDrNet
Clone elements of a netlist
Uniquify a netlist
Flatten a netlist representation
Compose an in memory netlist (write it to disk)