This document specifies the best practices for building RPA's in python using pybotlib. These requirements and specifications are the result of many years of building RPA's with python and deploying them to remote virtual Desktops using both Linux and Windows operating systems.
- pybotlib RPA: pybotlib RPA refers to a specific robotic process automation developed using the pybotlib and other python tools. When referring to an individual pybotlib RPA we are referring to all of the individual and static source code files that are hosted in a git repository and ready to be deployed.
A pybotlib RPA must follow the following directory structure:
<pybotlib RPA Name>
│ README.md # This contains documentation on RPA
│ run_RPA.sh # This runs one or more python scripts that execute the RPA
│ run_RPA.py # The RPA python code
│ get_pybotlib.sh # A script to get the latest version of pybotlib or other depends.
- Name: Strive to use Linux
- Description: Whenever not using specific applications that need to work on Windows, it is ideal to use ubuntu desktop enviornments to develop RPA's using python and pybotlib. The ubuntu-client branch is tested and can be deployed to any Ubuntu server running a Desktop enviornment such as GNOME, lxqt, MATEand others.
- Additional-Information: Additional relevant information to the specification
- Category: Techology
- Name: Decouple business input and output data
- Description: Any business process input data that is subject to change must be decoupled from the RPA and must remain in a separate source that is easily editable by human operators. For example a google sheets spreadsheet that the RPA will read from on execution to update any relevant business data will allow the business data to be seperate from the RPA source code. Any source code related to a pybotlib RPA must be static and should only be changed for fixing bugs or improving/adding features
- Additional-Information: I recommend running a local instance of Minio object storage and use it as a data input and output source for the RPA's to read and write to. Google Drive, One Drive, and other cloud storage options are also iable
- Category: Business
- Name: Single Entrypoint for RPA's
- Description: The entry point for the RPA must be bash executable. The entrypoint for the RPA must be called run_RPA.sh (or run_RPA.bat on windows). This bash file must contain first get_pybotlib.sh (a simple script that clones the most recent version of pybotlib.) Following this initial git clone the script should proceed to call any other scripts that are needed to run the and execute the RPA. Ideally the script should also cleanup the enviornment in which it ran in as any persisted data should be decoupled from the virtual desktop running the RPA. Using a single entrypoing script that is well commented allows for simple and easy deployment of individual RPA's. Complex RPA's may need various python scripts to be run in specific orders, this can all be controlled by the single entrypoint.
- Additional-Information: An example of run_RPA.sh is provided in this gist.
- Category: Techology
- Name: Use Git for versioning and deploying
- Description: Python RPA's are like other python programs and can be versioned using git. It is recomended to have a centralized repository of python RPA's within your orgranization and create individual repositories for every RPA. RPA projects tend to evolve over time and also need to be accessed by varios team member throughout a project. Using either an internal git server or private external git server such as Github or Bitbucket is essential for deploying, maintaining, and versioning RPA's.
- Additional-Information: You can spin up a simple internal private git server using an open source project called gitea.
- Category: Techology
- Name: use pybotlib logging
- Description: Pybotlib allows for the creation of on the fly csv log files that is taken care of by the pybotlib library. It is recomened to use this functionality to accurately log transactional and executional information and have the log files uploaded/sent to a decoupled cloud file storage service.
- Additional-Information: An example of the loggin capability of pybotlib can be found in the pybotlib git repository
- Category: Techology