Because the exposed DecodeInstruction functionality in IDA is quiet sucky, it can be easier to operate on textual representation. However, IDA even foils this as there doesnt seem to be a good way to get clean disassembly without it being intermingled with names, enums, local variables, etc.
idc.GetDisasm doesnt work, and idc.generate_disasm_line data in an obscure format that poses as a string (likely the internal representation of a textual line in IDA).
Example: IDA shows:
mov [rsp+168h+var_148], ebx
I want to get the clean disassembly
mov dword ptr ss:[rsp+0x20], ebx
How can I do this?
It seems absurd to ship a disassembly library with your IDA-Python script, but this is what most people seem to do.