Installation#
handcalcs is a pure-Python package on PyPI.
$ pip install handcalcs
or, with uv:
$ uv add handcalcs
Optional extras#
Extra |
Install |
Adds |
|---|---|---|
|
|
XlsxWriter, needed by the Excel renderer to write |
|
|
python-docx, needed by the Word renderer to write |
|
|
nb-hideinputs, Jupyter export options that hide input cells |
|
|
Sphinx and the theme used to build these docs |
Using handcalcs in Jupyter#
handcalcs does not install Jupyter itself. Install JupyterLab (or Notebook) in the same environment:
$ pip install handcalcs jupyterlab
Then, in a notebook, import handcalcs registers the %%render cell magic. See
the Jupyter interface.
Jupyter typesets the default Markdown output with MathJax, so no LaTeX installation is needed to see rendered calculations. You only need a LaTeX distribution if you export the notebook to PDF through LaTeX, or compile the output of the LaTeX renderer yourself.
Checking the installation#
>>> from handcalcs import HandCalcs
>>> from handcalcs.renderers import ASCIIRenderer
>>> print(HandCalcs(ASCIIRenderer()).demo()[:120])
demo() renders a built-in example calculation with whichever renderer you give it,
which is also a quick way to compare renderers.