Consider the following (pretty easy) translation of a simple table:
# This is not a useful or usable artifact; you're still trapped in Excel
# but things are just worse now, since it's not on a 2d grid
A1 = "Prices"
A2 = 1
A3 = 2
B1 = "With Tax"
B2 = SUM(A1, 10) * 1.3
B3 = SUM(A2, 10) * 1.3
But this is ultimately is an awful solution for the user:
1. It’s 100% impossible to read. A large Excel file often has 100k+ formulas (many of them with shared structures). This is 100k+ lines of code...
2. It’s impossible to maintain. Yeah, since it lacks all semantic structure, there’s no f* way you’re going to test it or modify it.To make it really concrete: you can't just transpile a SUMIF or VLOOKUP to a Python implementation of SUMIF or VLOOKUP, and you absolutely can't do this on a cell-by-cell basis.
Rather: we're trying to generate a Python script that appears to be written by an expert developer. To do this, you have to be willing to ditch the Excel formulas / execution engine, do more abstract reasoning over the file (like identifying tables / consistent formulas in columns and translating them as pandas dataframes), and translate them without just relying on matching the Excel exactly.
You want something closer to this:
df = pd.DataFrame({'Prices': [1, 2]})
df['With Tax'] = (df['Prices'] + 10) * 1.3
We want parity of outputs, not parity in how we get there!