What Is RPA? Robotic Process Automation

Use Python to automate business processes, process transactions, and communicate with other digital systems.

Samir Saci
10 min readAug 5, 2023
A diagram illustrating the automation of invoice processing using Robotic Process Automation (RPA). The process begins with multiple invoices in PDF format, which are then processed using Python. The data from the invoices is extracted and entered into an Excel file, followed by validation and uploading to a digital system. The diagram shows Python at the center, automating the data extraction, validation, and uploading of invoice data into a structured format, improving efficiency.
What is RPA? — (Image by Author)

RPA stands for “Robotic Process Automation” and refers to using software to automate business processes.

RPA solutions can be programmed to handle tasks such as data entry, transaction processing, and customer inquiry response, freeing up employees to focus on more value-added tasks.

As a data scientist, how can you boost the productivity of your company by automating boring manual tasks?

In this article, we will explore several libraries that can develop RPA tools using Python.

We will use case studies related to supply chain management.

SUMMARY
I. What is Robotic Process Automation? (RPA)
1. Example of the Automation of Invoice Management
2. How to create RPA tools with Python?
3. How do you package end-to-end automation tools with Python?
II. What are the challenges of RPA?
1. The Challenge of the Initial Setup
2. Integration with Existing Systems
3. Change management
4. Maintenance and updates
III. Other Examples of RPA Tools designed with Python
1. Generative AI: RPA Tools Powered by GPT
Design smart agents equipped with several automation tools
2. Automate PowerPoint Slide Creation with Python
Automate the creation of slides with visuals and comments
3. Automate Graphic Design using Python
Automate the creation of warehouse labels with Python
4. Automate Video Editing using Python
Cut training videos into #shorts with voice-over using TTS
5. Automate Flash Cards Creation for Language Learning with Python
Create flash cards to learn a new language with visuals and audio

What is Robotic Process Automation? (RPA)

Example of the Automation of Invoice Management

You are the finance manager in an international fashion retail company that receives thousands of PDF invoices each month.

These invoices must be manually entered into the accounting system, which is time-consuming and error-prone.

A diagram illustrating the automation of invoice processing using Robotic Process Automation (RPA). Invoices are received as PDFs, and the data is extracted using Python, then transferred to an Excel file for structured storage. The diagram shows the flow from invoice PDF to Excel, followed by the data being uploaded into a web-based accounting system, showcasing how RPA tools can automate data extraction and entry processes.
Invoice Management Process — (Image by Author)
  1. Admins receive invoices by email in PDF format.
  2. They extract information from the invoice (supplier, invoice number, company code, …)
  3. They copy the data into an Excel file used for accounting
  4. They input the same data into the web-based accounting system

What’s the problem?

And your team is complaining about this process

  • It is time-consuming, as they receive dozens of invoices daily, so they cannot allocate time to more added-value activities.
  • They tend to make input errors as the process of repetition affects their focus.
  • When the volume of invoices is getting high, the team accumulates a large backlog during busy periods.

Automating this process will free up time for your team, reduce errors, and avoid late payments due to a backlog.

💡 Assess productivity potential savings
Before investing time and resources in designing a solution, you need to assess the potential of productivity gains with RPA.

  1. What is the current process productivity?
  2. Can we improve this productivity without RPA?
  3. What would be the number of man-hours saved if you deploy this solution? How much is it in euros?
  4. What would be the total cost of design, usage and maintenance?
  5. What is the return on investment?

How to implement these tools?

How do you create RPA tools with Python?

If you type RPA on Google, you will find many ads from software companies that will propose their solutions.

This article shows you that everything can be done with a piece of coding using Python, VBA or any other programming language.

For the specific example of invoice management, let us go step by step to build a solution to automate the task.

Step 1: Read the PDF Invoice to extract data

A flow diagram representing the automation process of extracting invoice data using Python and storing it in Excel. Invoices in PDF format are processed using Python, and the extracted data is structured and transferred into an Excel spreadsheet. The image emphasizes the use of Python for automation and the transition from manual to automated data handling.
End-to-end process — (Image by Author)
  1. Use the pyPDF2 library to extract data from any PDF report
  2. Store the data in pandas dataframe(s)
  3. Use pandas to export this data frame in an Excel or CSV file

Steps (1, 2 and 3) are now fully automated, however

  • pyPDF2 does not always extract data in a readable format: you’ll need extra efforts to clean the data output
  • If the format of invoices is changing, your tool needs to be updated

Step 2: Update data in the accounting system

In this particular example, the accounting system is web-based. So you have two potential solutions.

  • If the software has an API, you can update information by sending HTTP requests to this API using the library. requests
  • If not, you can use browser automation tools like Selenium
A diagram showing how to use CSS selectors in Selenium to automate data input into a web-based accounting system. The image includes an example of locating elements on a webpage, such as an invoice number, zip code, and total price. The process uses CSS selectors to identify and interact with specific elements on the page, automating data entry tasks using web automation.
CSS Selectors for our example — (Image by Author)

With Selenium, you can automatically interact with your browser and automate any task.

  • Start by selecting the elements of the page you want to interact with using CSS selectors (to locate this element in the HTML code of the page)
  • You can then decide to write data in this element, click a button, or copy it to the clipboard.

You can then build a bot that connects to the page to create an invoice and pastes data in the fields (Supplier Code, Invoice Number …, etc.).

What’s the problem?

However,

  • Page loading issues or unexpected popups can impact this kind of solution.
  • If there is an update to the website, you need to rewrite your code

Step 2': Alternative Solutions

You still have a solution if your ERP, accounting system, or administrative software is not web-based.

Some software has automation modules that use scripting languages to interact with their UI.

In my blog, you can find an example using SAP GUI: Automate PO Creation with SAP GUI.

If not, you can use pyautogui library of Python to interact with elements on your screen.

A diagram illustrating how to use pixel coordinates to locate elements on the screen for automation. The example shows how to retrieve item codes, quantities, and total prices from an invoice using (x, y) coordinates. The mouse pointer is moved to specific coordinates on the screen to interact with elements, mimicking manual interactions such as clicking or entering data.
(x, y) coordinates — (Image by Author)
  • Locate the element using pixel coordinates and move the mouse
  • You can then click the element, write something and make it valid with enter or any key

How do you package end-to-end automation tools with Python?

You can now link the two blocks to fully automate the process and package your script in an executable file (.exe), so your colleagues can use it.

For more information, have a look at this article:

What are the challenges of RPA?

The Challenge of the Initial Setup

Setting up the automation infrastructure and processes requires a significant upfront investment in time and resources.

You need to make sure that you have a correct process mapping

  • Conduct interviews with admin teams to map processes and build workflows
  • Make sure that it’s compliant with the current process and safety controls (data input, ISO audits)
A workflow diagram representing the automated process of invoice management using Robotic Process Automation (RPA). The process starts with invoice data in PDF format, which is then converted into an Excel file. From there, it is processed into a web-based system for further accounting, financial reporting, and document storage. Each step is visualized, emphasizing the role of automation in reducing manual data entry.
Example of process workflow-(Image by Author)

Integration with existing systems

It requires integrations with other systems and data sources, which can be complex and time-consuming.

A flowchart illustrating the automated creation of PowerPoint slides for supply chain reports. It starts with 5 weeks of operational data from a warehouse management system database. SQL queries extract prepared order lines, which are processed by Python scripts to calculate KPIs. The output is a PowerPoint report with weekly warehouse workload and order profile visuals.
Automate PowerPoint Slides in 4 steps — (Image by Author)

In previous articles, I have shared solutions to automate PowerPoint slide creations and email report distributions.

  • They rely on libraries and APIs to connect with Microsoft Office Suite software.
  • Therefore, the code is extremely simple and robust: you’ll need limited maintenance.

If you cannot find a library like this for your project, you can use Pyautogui if we cannot connect via an API or Selenium.

This diagram outlines the process for automating a weekly operational report creation and email distribution using Python. It begins with data extraction from a Warehouse Management System (WMS) database, continues through SQL queries to extract prepared order lines, followed by Python scripts that calculate key performance indicators (KPIs), and ends with an automated report delivered by email, including visuals created in the HTML report.
Automate Email Reporting with Python — (Image by Author)

However, it is the least stable and easy solution to implement as it may require complex codes to have a robust solution.

Change management

It can lead to changes in employees' roles and responsibilities, and it is important to manage these changes effectively to ensure the smooth adoption of the technology.

It needs to be seen as a support for bringing quality and added value, not a tool for reducing the workforce.

Maintenance and updates

It is an added cost because these tools require regular maintenance and updates to continue functioning properly.

A comparison of two invoice table formats before and after process automation. The left side shows a basic table with item codes, quantities, and total prices. The right side adds an extra ‘Unit Price’ column, breaking down the price per unit for each item. The diagram demonstrates how RPA can enhance invoice processing by adding detailed calculations and restructuring data for better clarity and accuracy.
Example of page template changing — (Image by Author)

As an individual contributor, if you design RPA tools to support your colleagues, ensure you have time for maintenance, updates, and technical support.

Examples of RPA Tools Designed with Python

Generative AI: RPA Tools Powered by GPT

In November 2022, Automation experienced its most significant disruption with the release of OpenAI’s first version of ChatGPT.

Generative AI is the best opportunity to improve users' experience when dealing with Robotic Process Automation.

A diagram showing an automated supply chain control tower workflow with GPT and Langchain starting with ambiguous input (represented by question marks), proceeding through SQL queries, machine learning analysis, and generating insights that are communicated to users in an understandable form.
Supply Chain Control Tower Agent with LangChain SQL Agent [Article Link] — (Image by Author)

Instead of having a rigid User Interface with hard-coded actions within a specific scope, you can create smart agents with advanced automation tools.

This image outlines how a GPT agent interacts with an SQL database to answer specific supply chain questions. The query extracts data from a “shipments” table, providing insights like on-time delivery, delay analysis, and transit status. The SQL database is queried using timestamps and flags, enabling the agent to answer user-specific questions, improving decision-making in real-time.
Initial Prototype of an Automated Supply Chain Control Tower — (Image by Author)

In this article, I share my explorative journey of LLMs used to boost Supply Chain Analytics.

  1. Users can ask any question using natural language (English)
  2. The agent processes the question and creates SQL queries to collect data
  3. The agent uses the results of the query to formulate a proper answer
This diagram outlines how the custom GPTs for Supply Chain Analytics work. It starts with the user asking a question or requesting an analysis, the agent retrieves data (from the provided dataset or sample), processes it with a core Python script, and returns output as charts or comments. The flow clearly illustrates three key steps: initial prompt, data processing using the script, and final analysis outputs that is used by “The Supply Chain Analyst”.
Example of a smart agent architecture — (Image by Author)

Let’s suppose that you have multiple Python Scripts performing specific tasks on an ERP

  • Users can formulate their instructions using natural language
    “I would like to check the inventory level of SKU 1234; if it’s below 15 units, I would like to order 10 pieces.”
  • The agent would then use the RPA tools to check the inventory level and order items.
    “Agent: I will first check the inventory level of SKU 1234
    Agent: The inventory level is 12 units. I need to order 10 units.
    Agent: I order 10 pieces.”

💡 If you want to create your competent agent, more details in these two articles

Automate PowerPoint Slide Creation with Python

Several Python libraries allow programmers to interact with the Office Suite software.

As a data scientist, prepare a PowerPoint presentation to showcase the results of your analyses.

A flowchart illustrating the automated creation of PowerPoint slides for supply chain reports. It starts with 5 weeks of operational data from a warehouse management system database. SQL queries extract prepared order lines, which are processed by Python scripts to calculate KPIs. The output is a PowerPoint report with weekly warehouse workload and order profile visuals.
Workflow of the PowerPoint Slide Creation Tool — (Image by Author)

In another article, I shared the approach used to design a tool to automate the creation of PowerPoint slides.

A PowerPoint slide titled “Warehouse Workload (WEEK-1)” and “Order Profile” displaying two visuals generated with Python. The left chart shows the warehouse workload per day with a bar chart, and the right chart displays the order profile with the split of orders by the number of lines. Below each chart are insights, such as the number of orders and lines prepared during the week. A highlighted comment area at the top provides updated information and comments.
Example of Slides Generated Automatically — (Image by Author)

The tool extracts data from an SQL database, processes it, creates visuals with Python’s Matplotlib, which is included in a PowerPoint presentation, and automatically generates comments.

This tool can be linked to any data extraction, processing or advanced analytics tool that provides data outputs that can be visualized.

💡 For more information about the PowerPoint Automation tool,

Automate Graphic Design using Python

Have you ever been stuck with complex and time-consuming design tasks?

In this article, I shared the approach used to automate the design of labels using Python scripts.

Animation with hundred Warehouse labels with a large yellow upward arrow pointing toward the storage location generated with Python Pillow. It contains a barcode, SKU code 6090761375244, and icons indicating that the stored items are boxes, pants, and should be handled with care due to liquid content.
1000+ labels automatically generated with Python — (Image by Author)

The approach is simple: a label combines several graphic items with specific locations.

Annotated warehouse label showing spatial coordinates for positioning icons, barcodes, and product information with Python Pillow. The label design uses a top-left corner origin system, and the arrows guide users to the correct picking location. Icons provide information on storage and handling requirements.
Items location in the label — (Image by Author)

Using Python’s library Pillow, we can generate a label by pointing each element with

  • Vector Icons bank for the three icons on the right
  • A bar code generated with Python
  • Text and arrows generated with Pillow

💡 For more details,

Automate Video Editing with Python

Have you ever been stuck in video editing tasks?

Illustration of the inbound process for warehouse operations, showing unloading, receiving, and pallet wrapping. Step 1 arranges the receiving time slot; Step 2 shows unloading goods from the truck; and Step 4 depicts pallet wrapping using a semi-automatic wrapping machine. The diagram emphasizes productivity optimization during these steps in the inbound process.
Examples of training screens — (Image by Author)

Imagine you need to create training videos to make them more engaging for your warehouse operators.

Flowchart showing the process of automating video editing with Python. The raw video is processed by muting the background music and cutting the video into shorter clips. Each short video is then paired with text-to-speech comments, creating three distinct clips, ‘Short 1’, ‘Short 2’, and ‘Short 3’, each with its corresponding comment.
Automation Workflow — (Image by Author)

The workflow is straightforward,

  1. You have a long video you want to use to create #shorts
  2. After muting the music, you want to cut it into short videos automatically.
  3. Finally, add a voice-over, using a Text-To-Speech solution, to comment on each short's key takeaways.

💡 Do you want to automate video editing?

Automate Flash Cards Creation for Language Learning with Python

I have shared my experience using Python to support my long journey in learning Mandarin as a native French speaker who is “not good with languages”.

I want to study chinese written in Mandarin Simplified
I want to study Chinese — (Image by Author)

In my quest for Mandarin fluency, flashcards have been my best ally in improving oral comprehension, reading capabilities and pronunciation.

Screenshot from the Anki flashcard app showing a Mandarin language flashcard. The card on the left displays the Chinese characters ‘你好!’ (Hello), prompting the user to guess the translation and pronunciation. The card on the right shows the answer with ‘Nǐ hǎo!’ in pinyin and ‘Hello!’ in English. This illustrates how Anki presents questions and answers to help users learn new words and improve their language skills.
Example of Flash Cards with Anki — (Image by Author)

In this article, I share the automated workflow designed to

  • Create vocabulary lists for daily life and work
  • Translate the words in English and add the phonetics
  • Add text-to-speech transcription with Google API

💡 Use Python to boost your language skills!

About Me

Let’s connect on Linkedin, I am a Supply Chain Engineer using data analytics to improve logistics operations and reduce costs.

For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.

If you are interested in Data Analytics and Supply Chain, look at my website.

💌 New articles straight in your inbox for free: Newsletter
📘 Boost your Productivity with Data Analytics: Productivity Cheat Sheet

💡 Follow me on Medium for more articles related to 🏭 Supply Chain Analytics, 🌳 Sustainability and 🕜 Productivity.

--

--

Samir Saci

Top Supply Chain Analytics Writer — Follow my journey using Data Science for Supply Chain Sustainability 🌳 and Productivity ⌛ https://samirsaci.com/about