Point at a .xlsx or .pbix, see the queries inside it, add one, save it back
into the file, and run it. That last half is what 0.8.0 adds.
pip install pqtools
pq list book.xlsx # Clients, Colors, Countries, Invoices, Stock
pq add book.xlsx --name "Top Colours" \
--source 'let S = #table({"Colour","N"},{{"Blue",5},{"Red",3}}) in S' --write
pq eval book.xlsx --member "Top Colours" --format csv
# Colour,N
# Blue,5
# Red,3New
pq list FILEnames every query in a container.pq add FILE --name N --source '...'adds a new one.--writesaves it in.--writenow works onformat/rename/replace-source/addfor
containers. Every container write copies the original to<file>.bakfirst.- Local-file sources run locally:
File.Contents,Csv.Document,
Text.FromBinary, and theBinary.*family. The engine boundary is about
capability, not the word "connector" -Sql.DatabaseandWeb.Contents
still refuse, by design. #tableand#binaryare registered, so a literal table written the way
a person actually writes it now runs.#shared/#sectionssay they need
the enclosing section document instead of reading like a typo.
Fixed - two bugs that had green test suites
- UTF-16 DataMashup. Real Excel writes
customXml/item1.xmlas UTF-16 LE
with a BOM. Every real workbook therefore reported "no DataMashup part
found". The test fixture wrote UTF-8, which is why nothing caught it. - Quoted identifiers were never unquoted.
[#"First Name"]looked up a
field literally named#"First Name". Quiet, because step names round-tripped
by matching themselves. Fixed at the root;containers.split_sharedhad its
own copy of the same bug.
How the write path was checked
680 tests, 89% coverage, ruff + mypy + the pinned Microsoft parser bridge clean.
Container writes are verified four ways: CRC intact, every zip member except the
DataMashup part byte-identical, the M reading back, and openpyxl - an
independent xlsx parser - opening the rewritten workbook to the same sheets and
cells as the original. Two real Excel-authored workbooks, 21,215 cells
compared, zero differences.
Residual risk, stated plainly: Excel itself has not opened a rewritten
workbook, because Excel was not installed where this was validated. That is why
every --write leaves a .bak.
Unofficial. Not affiliated with or endorsed by Microsoft. pq eval runs a
query's transformation chain locally; it is not a Power Query runtime and never
pretends to be one.