Reuse Your Scripts and Keep Data Private
The real payoff of automation comes the second, third and tenth time. A script you wrote once with AI's help should run next month in two minutes, without asking the AI again. This lesson shows how to turn your notebook into a reusable tool, and how to do all of this without exposing private data.
What You'll Learn
- How to turn a script into a reusable monthly tool
- How to put all the settings in one place at the top
- What to share with an AI chatbot, and what never to share
- How to make fake sample data that is safe to paste
- Where to go next to keep learning
Make a reusable tool
A script becomes a tool when someone can run it without changing the code. Three habits get you there.
1. Put the settings at the top
Anything that changes each time, like the month, a file name or a folder, should be in one clearly marked cell at the top. Ask the AI:
The top of your notebook will then look something like this:
# ===== SETTINGS: change these each month =====
INPUT_FOLDER = "Sales 2026" # Google Drive folder with the monthly files
SHEET_NAME = "Sales" # sheet to read in each file
OUTPUT_FILE = "sales_summary.xlsx" # name of the file to create
# =============================================
2. Add a short "how to use" note
Click + Text at the top of your Colab notebook and write three or four lines in plain English: what the notebook does, what files it needs, what to change in SETTINGS, and how to check the result. Your future self, and any colleague you share it with, will thank you.
3. Keep the files in Google Drive
Store the notebook and the input files in one Drive folder. Then next month the steps are: drop in the new files, update SETTINGS, click Runtime, then Run all, and check the printed row counts.
Keep data private
Automation often touches sensitive data: salaries, client names, student marks, health records. Follow these rules.
The AI does not need your real data
To write a script, the AI only needs to know the shape of your data: column names, a few example rows and what you want done. It does not need the real values. So:
- Share column names freely; they are rarely sensitive.
- For example rows, use made-up values in the same format.
- Never paste full files, customer lists, salaries, ID numbers, passwords or health information into a chatbot unless your school or employer has approved that tool for that data.
Make safe fake sample data
You can even ask the AI to create fake data that matches your format, so you can test without touching real files:
Test your script on the fake file. When it works, run it on the real file yourself. The real data never goes to the chatbot.
Know where your data goes
- The chatbot: anything you paste may be stored by the AI company. Check the chatbot's data or privacy settings; many let you stop your chats from being used to train models.
- Google Colab: your code runs on Google's servers under your Google account, and uploaded files sit there temporarily. Follow your organization's rules about which cloud tools are allowed for work data.
- Your own computer: if a file is too sensitive for any cloud tool, ask someone in your IT team about running Python locally, or keep that job in Excel.
When in doubt, ask before you upload. It is much easier than explaining a data leak later.
A repeatable checklist
Every time you automate a new Excel job:
- Describe input, columns, steps, output and where it runs.
- Use fake or anonymized sample rows in the prompt.
- Run on a small copy first.
- Check row counts, one known total and a few rows.
- Move settings to the top and add a how-to note.
- Save it in Drive and reuse it next time.
Where to go next
- Practice pandas step by step in Pandas Data Wrangling.
- Learn Python basics properly in Python Basics if you want to edit scripts yourself.
- Analyze spreadsheets by chatting with AI, no code, in Use AI for Data Analysis.
- Write better Excel formulas with AI in AI Excel Formulas.
- Automate other boring tasks in Automate Boring Tasks.
- For finance work, see Data Analytics with Python for Finance.
Key Takeaways
- A script becomes a reusable tool when all changeable settings are at the top and a short how-to note explains it.
- Keep the notebook and input files together in Google Drive and use Run all each month.
- The AI only needs the shape of your data; use column names and fake example rows.
- Never paste sensitive data into a chatbot unless the tool is approved for it.
- Test on fake or small data first, then check the real result every time.
Quiz
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

