Got reminded of a project I did while back. It's a Python based assembler. The main idea is that the assembly file is actually a Python file with pre-set functions (assembly instruction).
In this manner, I managed to skip lexing, parsing and other things and deliver a working assembler in
two days.
You can view the presentation I gave on this
here.
The Assembler
Example Input