Programmatically creating product attributes

I’m new to the web development and programming thing, so if this is a stupid question, I’m sorry.
I’m working on writing a php script that will read a CSV file with properly configured headers and generate the necessary files for mass custom attribute creation. I’ve been reading the devdoc on the process of creating an attribute by manually coding everything and it seems fairly straight forward, however there’s a few questions I can’t find answers to, and I would like some feedback before I proceed further.

When creating the modules under app/code/ is it necessary for me to create modules at that level, i.e. magento/app/code/module_name? If I modify the namespace values in the InstallData script, source model, backend, and frontend models to reflect the new directory will I run into database issues if the modules are down one level, i.e. magento/app/code/product_category/module_name,

Second, is it necessary to have an InstallData script for each generated module, or can I compile the generated portions of the install script into a single script?

submitted by /u/brother_Kirik
[link] [comments]