A Python script that automates a repetitive office task end to end: it opens the browser, downloads a sales spreadsheet from Google Drive, calculates the key figures with Pandas and emails a report automatically.
Language: Python · Libraries: PyAutoGUI, Pandas, OpenPyXL, Pyperclip · Status: Completed (learning project)
Demo video: assets/sales_report_automation.mp4
Many daily office tasks follow the same steps every time: open a system, download a file, check the numbers and send them to someone. This project automates that routine so it runs with one command, simulating a real business workflow. It was built during the "Python Impressionador" course by Hashtag Treinamentos.
- Browser automation: opens the browser and navigates to a Google Drive folder
- File download: uses PyAutoGUI mouse and keyboard control to download the sales file
- Data processing: reads the Excel file with Pandas and calculates total revenue and total quantity sold
- Email report: opens Gmail, writes the email and sends the figures automatically
| Library | Purpose |
|---|---|
| PyAutoGUI | Controls the mouse and keyboard |
| Pandas | Reads and summarises the spreadsheet |
| OpenPyXL | Excel file support for Pandas |
| Pyperclip | Pastes text (subject and body) via the clipboard |
pip install pyautogui pandas openpyxl pyperclip
python python_sales_automation.pyNote: PyAutoGUI clicks on fixed screen coordinates, and the download path is set for my machine. To run it elsewhere, adjust the coordinates and the
file_pathvariable to match your screen and Downloads folder.
python_sales_automation.py Main script
assets/ Demo video and screenshot
- Download the file through the Google Drive API instead of screen clicks
- Send the email with
smtplibor the Gmail API instead of the interface - Read settings (paths, recipient) from a config file
- Schedule the script to run automatically every day
- Breaking a manual process into small, repeatable steps
- Automating the mouse and keyboard, and the limits of that approach
- Using Pandas to summarise spreadsheet data quickly
- Thinking about how automation saves time on repetitive support and admin tasks
Guilherme Lima · Aspiring IT Support Technician · LinkedIn · GitHub