Running Python
The AI generates Python; HISAB runs it sandboxed; results land in your sheet.
Pre-installed packages
HISAB ships with CPython 3.11 and a curated set of ~40 pre-installed packages:
- Data: pandas, numpy
- Excel / Office: openpyxl, python-docx, python-pptx, lxml
- PDF: reportlab, pypdf, pdfplumber, pdfminer, pypdfium2
- Charts: plotly (interactive HTML; static PNG needs kaleido, not bundled)
- Images: pillow
- Utilities: rapidfuzz, dateutil, pytz, charset-normalizer
- Standard library: json, math, re, datetime, decimal, collections, itertools, functools, statistics, csv, io, hashlib, base64
Sandbox guarantees
The Python interpreter runs in an isolated CPython process with these restrictions:
- Filesystem read/write limited to a per-run temp folder and the active workbook range API
- Network access disabled by default (skills can opt-in for specific hosts)
- Subprocess spawning blocked
- 30-second wall-clock limit per execution (configurable per skill)
- 2 GB memory limit
Excel I/O from Python
HISAB injects a hisab helper module into every Python run:
import hisab as h
# read a range as a pandas DataFrame
df = h.read_range("Bank Statement", "A1:E1000")
# write back to a (new or existing) sheet
h.write_range("Mismatches", "A1", df_unmatched)
# create a sheet
h.create_sheet("Reconciliation Summary")
# refresh formulas
h.calculate()