It's a Python 3 script that will create an all-in-one OpenSCAD model that includes the model plus all of the libraries that the model depends upon into a single file. It doesn't attempt to detect module or function dependencies within a library; it just grabs the entire library file, but ensures that any one library file will only be included once.
Thanks Craig for that python script - very useful. I made a small change to
the include regexp because the syntax doesn't require a terminating ;
INCLUDE = re.compile( '^include <(.*)>;?$' )
I can see that expanding use statements does require more parsing.
Some of my libraries are quite big so I would like to include only the
functions and modules referenced but that needs a full parse. I've just
found a new JS project
https://www.npmjs.com/package/openscad-parser which looks like it could be
adapted to do the job and to support visualisation of the call network.