Choose a model: use Sonnet to conserve tokens; Opus is more thorough but uses tokens much faster
I would set permission mode to auto-accept, but do what you feel comfortable with.
Example
Copy and past the following into the Code tab of Claude Desktop:
Create an Excel workbook with a loan amortization table for a $300,000 mortgage at 6.5% annual interest with a 30-year term and monthly payments. Use formulas so I can change the loan amount, rate, and term. Include columns for payment number, payment, principal, interest, and remaining balance.
Building Small Web Apps
How Web Browsers Work
A web browser is a program that downloads and runs code — HTML, CSS, and JavaScript — delivered by a server when you visit a URL.
HTML defines the content and structure
CSS controls the visual styling
JavaScript adds interactivity and computation
Right-click any webpage and choose View Page Source to see the code your browser is running.
Pyodide is a JavaScript library that compiles Python to WebAssembly so it runs natively inside the browser. The result: Python code executing inside JavaScript, inside your browser — no server, no installation.
Running Python in the Browser
Pyodide is a full Python runtime compiled to WebAssembly. It runs inside a browser tab — no server, no installation.
What Pyodide Provides
Full CPython interpreter in the browser
NumPy, pandas, and other scientific packages
Bidirectional JavaScript ↔︎ Python interop
What You Can Build
Calculators and financial models
Interactive charts and dashboards
Any tool that runs entirely in the browser
This is the same technology Claude uses under the hood for artifacts — a self-contained HTML file with Pyodide embedded in it.
Example: NPV Web App
Ask Claude Code:
“Create an HTML file called npv.html that uses Pyodide to compute NPV. Provide input cells for cash flows at dates 0 through 5 and a discount rate. Compute and display the NPV when the user clicks a button.”
Then:
Find npv.html in your project folder
Double-click it — it opens in your browser
Enter cash flows and a discount rate, click the button, and see the NPV
The HTML file is self-contained. Anyone can open it — no Python installation needed.
Example: Bar Chart Race
Download marketcap.xlsx — end-of-year market cap by sector, 2000–2025.
Upload it to Claude and ask:
“Build a web app with a bar chart race to show how the sizes of different sectors have changed over time.”
Claude reads the data and writes the Plotly code — you get an interactive animated chart without writing a line of code.
Working with Files
Download the Example Files
Download module4.zip and extract it to a folder on your computer.
Point Claude Code to that folder. It contains three subfolders:
Example1/ — portfolio holdings spreadsheet
Example2/ — loan terms document and payment history spreadsheet
Example3/ — earnings PDF report and stock prices spreadsheet
Example 1
Copy and paste the following into the Code tab of Claude Desktop:
Read the file Example1/portfolio.xlsx, which contains holdings with columns for ticker, asset class, sector, and market value. Create a pivot table showing total market value by asset class and sector. Save the pivot table to a new file called summary.xlsx.
Merging Data from Different Sources
Real financial data rarely lives in a single file or format. Claude Code can read Excel, PDF, and Word files, then combine, filter, and aggregate.
%%{init: {'theme': 'base', 'themeVariables': {'fontSize': '28px'}, 'flowchart': {'nodeSpacing': 80, 'rankSpacing': 120, 'padding': 24, 'useMaxWidth': true}}}%%
flowchart LR
WRD["<b>Word</b>"] --> CC["<b>Claude Code</b><br>Merge, Filter, Aggregate"]
XLS["<b>Excel</b>"] --> CC
PDF["<b>PDF</b>"] --> CC
CC --> UT["<b>Unified Table</b>"]
style WRD fill:#eff6ff,stroke:#3b82f6,stroke-width:2px,color:#0f172a,font-size:28px,padding:20px
style XLS fill:#eff6ff,stroke:#3b82f6,stroke-width:2px,color:#0f172a,font-size:28px,padding:20px
style PDF fill:#eff6ff,stroke:#3b82f6,stroke-width:2px,color:#0f172a,font-size:28px,padding:20px
style CC fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,color:#0f172a,font-size:28px,padding:20px
style UT fill:#fff7ed,stroke:#ea580c,stroke-width:2px,color:#0f172a,font-size:28px,padding:20px
Example 2
Copy and paste the following into the Code tab of Claude desktop:
The file Example2/loan_terms.docx contains a table with columns for borrower, loan type, origination date, principal, and interest rate. The file Example2/payments.xlsx contains monthly payment records with columns for borrower, date, and payment amount. Combine the two files on borrower name. Filter to loans with original principal above $500,000. Compute average interest rate and total original principal by loan type and save the results to summary.xlsx.
Example 3
Copy and paste the following into the Code tab of Claude Desktop:
The file Example3/earnings.pdf contains a table of Q4 2024 earnings results with columns for ticker, company, revenue, EPS, and guidance. The file Example3/prices.xlsx contains closing stock prices. Read both files, merge on ticker, and compute the price-to-earnings ratio for each company. Save the results sorted by P/E ratio to pe_analysis.xlsx.