What Is RPA? Robotic Process Automation
Use Python to automate business processes, process transactions, and communicate with other digital systems.
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.
- Admins receive invoices by email in PDF format.
- They extract information from the invoice (supplier, invoice number, company code, …)
- They copy the data into an Excel file used for accounting
- 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.
- What is the current process productivity?
- Can we improve this productivity without RPA?
- What would be the number of man-hours saved if you deploy this solution? How much is it in euros?
- What would be the total cost of design, usage and maintenance?
- 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
- Use the pyPDF2 library to extract data from any PDF report
- Store the data in pandas dataframe(s)
- 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
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.
- 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)
Integration with existing systems
It requires integrations with other systems and data sources, which can be complex and time-consuming.
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.
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.
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.
Instead of having a rigid User Interface with hard-coded actions within a specific scope, you can create smart agents with advanced automation tools.
In this article, I share my explorative journey of LLMs used to boost Supply Chain Analytics.
- Users can ask any question using natural language (English)
- The agent processes the question and creates SQL queries to collect data
- The agent uses the results of the query to formulate a proper answer
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.
In another article, I shared the approach used to design a tool to automate the creation of PowerPoint slides.
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.
The approach is simple: a label combines several graphic items with specific locations.
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?
Imagine you need to create training videos to make them more engaging for your warehouse operators.
The workflow is straightforward,
- You have a long video you want to use to create #shorts
- After muting the music, you want to cut it into short videos automatically.
- 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”.
In my quest for Mandarin fluency, flashcards have been my best ally in improving oral comprehension, reading capabilities and pronunciation.
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.