> For the complete documentation index, see [llms.txt](https://calctree.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calctree.gitbook.io/docs/calculations/creating-calculations/python.md).

# Python

Create Python-powered functionality and integrate it to your page with zero setup.

CalcTree allows you to write and run Python scripts as part of your engineering calculations. There is no need to install development tools, manage environments, or configure deployment—everything runs in the cloud.

Use Python when you need more flexibility than standard formulas provide, or when your work involves data manipulation, visualisation, or access to Python libraries.

### Key Benefits

* **Write actual Python code**\
  Use familiar syntax and control structures to perform calculations.
* **Access engineering libraries**\
  Instantly use [pre-installed Python libraries](https://calctree.gitbook.io/docs/calculations/python-in-calctree/using-pre-installed-python-libraries) such as `numpy`, `matplotlib`, `sectionproperties`, `anaStruct`, and many more.
* **Work with units**\
  Use `ct.quantity()` to interact with unit-aware calculations on your page. Automatically enforce unit consistency between values.
* **Generate visuals**\
  Produce plots and diagrams using `matplotlib` and embed them directly in your CalcTree pages.
* **Link to other sources**\
  Reference parameters from other blocks—including MathJS, tables, and spreadsheets—within your Python script.

### Typical Use Cases

* Generate diagrams and chart plots with Python and `matplotlib`&#x20;
* Run heavier analysis like FEA by using libraries such as `opensees.py`&#x20;
* Extract and interact with data from files uploaded to CalcTree pages
* Run a loop across various input instances and generate output scenarios

### Next Steps

To get started, continue with:

* [Adding a Python source](/docs/calculations/creating-calculations/python/adding-a-python-node.md)
* [Defining parameters](/docs/calculations/creating-calculations/python/python-variables.md)
* [Referencing other parameters in Python](/docs/calculations/creating-calculations/python/variables-from-other-nodes.md)
* [Working with units](/docs/calculations/creating-calculations/python/units.md)
* [Creating tables and visuals](/docs/calculations/creating-calculations/python/tables-and-visuals.md)
* [Consuming files](/docs/calculations/creating-calculations/python/consuming-files.md)
* [Using pre-installed Python libraries](/docs/calculations/creating-calculations/python/pre-installed-libraries.md)
