Alter a complete 3dm File using ghpython

Is it possible to use GHpython node to check a hole 3dm File (open or from Path)?
I want to check for layer/ layernames and also for material Names, and then group/join according to the results. and write the altered files to disk.
is that even possible?
Thanks j