Consuming Files in Python
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.
Uploading Files (Learn more here)
To upload a file:
Open the right-hand integrations panel on your CalcTree page
Click + Add
Select File Upload and select your file
Once uploaded, the file will appear in the “Uploaded files” section

Accessing Files in Python
Uploaded files are accessible through the ct.page_files
dictionary using the file name as the key. For example:
import pandas as pd
# Load a CSV file uploaded to the page
df = pd.read_csv(ct.page_files['my_input_data.csv'])
This pattern works for any file type compatible with your chosen Python libraries.
Use Cases
Load tabular data using
pandas.read_csv()
Import geometric or CAD files (e.g.
.dxf
) using domain-specific librariesUse in conjunction with plugins to automate processing of data files from ETABS etc. into reports in CalcTree
Notes
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 template examples.
Last updated