×
all 12 comments

[–]ianitic 6 points7 points  (0 children)

Have pandas/polars or duckdb(if you know sql choose this) read in sources and export to excel to separate workbooks. If you must you could use vba within excel that calls the Python script then refreshes PQ to consume the resulting file.

Otherwise you can use PowerBI which has Python available within PowerQuery as well as r. Likely PQ will just perform better in PBI anyways though.

Otherwise there's definitely a handful of ways you can daisy chain it like the vba calling python way.

[–]marr75 3 points4 points  (1 child)

Just cut the Excel out.

[–]keithcu 1 point2 points  (3 children)

I built a plugin for LibreOffice Writer/Calc: https://github.com/KeithCu/writeragent

I'll look into adding PowerQuery features 🤣

More from r/Python

  Hide

Comments, continued...

[–]amazonv 1 point2 points  (1 child)

[–]Puzzleheaded_Luck641[S] 0 points1 point  (0 children)

Python is Also available excel native but external Data or operation doesn't work. Performance is super super slow. Because it's send the data to Microsoft server

[–]No_Soy_Colosio 0 points1 point  (0 children)

Probably not, but you can just extract the data from the file and process with Polars/DuckDB if you prefer SQL.

[–]Meathixdubs 0 points1 point  (0 children)

I tried forcing Excel to be the center of everything for way too long and it just got messy.

DuckDB ended up feeling way cleaner for me, especially if you’re already semi-comfortable with SQL. Less fighting the tool, more just getting stuff done.

[–]fzumstein 0 points1 point  (0 children)

If you don't like xlwings (why, by the way?), check out the new xlwings Lite, which doesn't rely on a local Python installation but still runs locally via WebAssembly. it support DuckDB and Polars and allows you to define automation scripts, custom functions, and now also Jupyter notebooks.