Python in CalcTree

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, units, visualisation, or access to engineering 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 such as numpy, matplotlib, sectionproperties, anaStruct, BeamBending, 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

  • Run heavier analysis like FEA by using libraries such as opensees.py

  • 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:

Last updated