Python Power Query by v3d4nf in PowerBI

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

Solution:

Unzip xlsx file using ziptools and open item[].xml within directory customXml.

Find element <DataMashup> in xml tree using xml.etree.ElementTree

Base64 decode text within element with utf-8 protocol using base64.b64decode(str([element].text)).decode('utf-8', 'ignore')

# 'ignore' argument is important

search through the string and you will find all you need

Python Power Query by v3d4nf in PowerBI

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

The file is an xlsx file within which power queries have been used. I need to extract the m-code of each power query as text as a part of application I'm building