Consuming Files in Python
Create Python-powered calculations
Last updated
Create Python-powered calculations
Last updated
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 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
Uploaded files are accessible through the ct.page_files
dictionary using the file name as the key. For example:
This pattern works for any file type compatible with your chosen Python libraries.
Load tabular data using pandas.read_csv()
Import geometric or CAD files (e.g. .dxf
) using domain-specific libraries
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
Use in conjunction with to automate processing of data files from ETABS etc. into reports in CalcTree
For file upload instructions, refer to our . To see this in practice, check our examples.