I’ve just recently written a script which imported a load of content from flat files into Tridion. Using the flat files, the script creates the various folders, pages and components etc that it needed. Unfortunately I cannot share the code as the client contract permits me to do (plus it was a throw-away tool written specifically around the format of the import data) but I can share a couple of titbits that I learnt about item naming and WebDAV lengths.
Some notes about Tridion item naming
3