Processing eBay category list for database import
I don't have many comments regarding your style, as it seems to follow PEP8 (to my knowledge), so lets review the actual code:


Implementation of Stack – A straight forward implementation without to much fuzz. You don't have any error checking related to popping something of an empty stack, which might give you a problem at some point
Implementation of extract_info – No error handling if faulty input, which could let it return nothing at all if nothing matches on the if field: line
rdr is not a good name – It is not clear what next(rdr) actually does, try finding a better name here
Simplify if structure – You repeat statements within the if structure, and these could be moved outside of the if structure, which would help readability. In addition you pop/push too many times. Try the following:


if level &lt;= last_level:
    id_stack.pop(last_level - level + 1)

parent_id = id_stack.peek()

id_stack.push(cat_id)
last_level = level



Change to newer print – The currently recommended standard for printing seems to be of the form: print('{} {} {} {} {}'.format(level, '..'*level, name, cat_id, parent_id)). In your case it complicates stuff, but in the long run you can pretty print much better using the newer form and variation thereover


Edit: Original code had a little flaw regarding the parent_id. The now corrected code gives the same output when using the provided CSV file as the output from original code.