> 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/integrations/csv-files.md).

# CSV files

Upload CSV files as a data source to be consumed by your Python script.

You can upload any file type to a CalcTree page, and the uploaded files will be available to Python scripts.&#x20;

1. Go to **Files** from the right panel
2. Click the **'+'** button
3. Add a CSV file

After uploading, the file appears in the list of files against that page, and is accessible to Python via `ct.page_files['file_name']`. See example below:

<figure><img src="https://94933883-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1yC9mBIPsA0bB8PMGaq%2Fuploads%2FVUZOECwl0yrMglR1AHvj%2FScreenshot%202025-10-15%20at%203.13.46%E2%80%AFPM.png?alt=media&amp;token=60d15895-c4ab-4641-ac8a-714128e5d206" alt=""><figcaption></figcaption></figure>

Use [Python](https://calctree.gitbook.io/docs/create-calculations/python) to interact with the uploaded file. Here's an example of how you might load the `Load_Pattern_Definitions.csv`  into a pandas dataframe.

```python
import pandas as pd

def read_csv(csv):
    return pd.read_csv(ct.page_files[csv]).astype('object').fillna("")
    
load_patterns_df = read_csv("Load_Pattern_Definitions.csv")


```

Download the file below and test the steps above for youself:

{% file src="/files/J602Sfh00cwiax9R5Cv6" %}
