Automate Tasks

How to build scripts and tools that automate boring stuff in your life or work. We’ll show you examples of automation projects that others actually want to use. Turn your repetitive tasks into useful open source tools.

A key aspect you may not have thought about is automating repetitive tasks in your daily life or work. In present day, this has never been easier.

Current State

Let me try to paint a picture. These things are currently true:

  • Local LLM: You can run a local Large Language Model (LLM) on your home network on a computer with a decent GPU (or a Mac with Apple Silicon). This is possible with Ollama and OpenWebUI. You can easily interact with it’s API to give actual intelligence to any script.
  • Python: Doesn’t matter if you don’t know Python. Python can easily work with spreadsheets, databases, API’s, your local LLM, and it can do things like screenscrape websites.

That means that you could potentially automate all kinds of things, especially things that you do on a regular basis. If you use home automation like Home Assistant or maybe you use fitness trackers? You could create automation around those things AND add LLM intelligence to it too.

Book: Automate the Boring Stuff with Python

This very popular book is a great introduction to this topic:

Automate the Boring Stuff with Python, 3rd Edition

This is available at:

Amazon: Automate the Boring Stuff with Python, 3rd Edition

There is also a free online version of the book available at:

https://automatetheboringstuff.com

Book: Violent Python

For cybersecurity-related topics in the same vein of automating everyday tasks:

Violent Python

This is available at:

Examples

Knowing that with Python you do these things, you can automate a lot of tasks:

  • Web Scraping: Use Python libraries like BeautifulSoup or Scrapy to extract data from websites.
  • Data Processing: Use libraries like pandas to manipulate and analyze data from spreadsheets or databases.
  • API Interactions: Use Python’s requests library to interact with web APIs, automate data retrieval, or send data to services.
  • File Management: Automate file organization, renaming, or processing tasks using Python’s built-in libraries.
  • Task Scheduling: Use Python’s schedule library to run scripts at specific intervals, automating routine tasks.

Some real-life examples of automating tasks with Python and LLMs:

  • Email Summarization: Use an LLM to summarize long email threads or extract key information from them.
  • Data Entry Automation: Use Python scripts to read data from spreadsheets and automatically enter it into web forms or databases.
  • Social Media Posting: Automate the posting of content to social media platforms using their APIs, potentially with LLM-generated content.
  • Home Automation: Integrate Python scripts with home automation systems to control devices based on certain triggers or schedules.
  • Personal Finance Tracking: Use Python to scrape financial data from websites, analyze spending patterns, and generate reports.

But How?

If you are not familiar with Python, that is where your LLM’s can help - significantly! For example, if you were to use VS Code as your code editor, and set up GitHub Copilot, you could get AI-assisted code suggestions as you write your scripts. For example, in an empty directory with an empty main.py file open, you could ask Copilot:

“I need to create a Python script that scrapes the data from https://www.imdb.com/calendar/, which are upcoming movies, and extract the: title, description, genres, release date, and list of actors into a spreadsheet: C:\data\movies.xlsx. Please don’t overwrite this, this should be an ‘upsert’ where you add any missing data, and update existing rows. This should run once a day, I’ll schedule it via a different mechanism. Then, if there are any NEW movies that weren’t in my spreadsheet, with Jackie Chan starring, please send me an e-mail at [email protected] and push a notification to my ntfy.sh channel: https://ntfy.sh/jackie-chan-movies"

This should give you a pretty decent starting point for your script, and you can tweak it from there. Ultimately though, when this runs, this should scrape that data, update your spreadsheet, and then send an e-mail and push notification if there are any new Jackie Chan movies.

Do this as a public project! This could/should be a public repo on GitHub. And also, you can write a blog post about it AND if your up for it, create a YouTube video about it and cross-link it with your blog post. This would be a great Saturday morning project!