Create Python-powered calculations
You can upload any file type to a CalcTree page and access it directly within your Python script. This is useful for referencing input datasets such as CSVs, DXF files, or configuration files.
To upload a file:
Open the right-hand panel on your CalcTree page
Click on the Files Tab
Click on '+'
Select your file
Once uploaded, the file will appear in the Files Tab
Uploaded files are accessible through the ct.page_files dictionary using the file name as the key. For example:
ct.page_files
This pattern works for any file type compatible with your chosen Python libraries.
Load tabular data using pandas.read_csv()
pandas.read_csv()
Import geometric or CAD files (e.g. .dxf) using domain-specific libraries
.dxf
Use in conjunction with plugins to automate processing of data files from ETABS etc. into reports in CalcTree
File names must match exactly (including extension)
Uploaded files are only available within the page they are uploaded to
Large files may increase processing time
For file upload instructions, refer to our CSV File Upload Guide. To see this in practice, check our templatearrow-up-right examples.
Last updated 4 months ago
import pandas as pd # Load a CSV file uploaded to the page df = pd.read_csv(ct.page_files['my_input_data.csv'])