The cw-rpa package provides reusable functions/common utilities for developing CW RPA bots.
Actively maintained. Last release 3 weeks ago. A safe choice.
pip install cw-rpaRPA Library : A custom Python Library for Building (RPA) bots Solutions for Partners
RPA Library is a comprehensive Python library designed to empower partners to efficiently development of Robotic Process Automation (RPA) solutions. This library provides essential functionalities and utilities, simplifying the RPA development process. This library provides a set of modules that streamline the process of automating tasks, managing inputs, logging, and interacting with web services.
Modules Overview
The RPA Library consists of several key modules, each designed to offer specific functionalities that aid in the development of RPA solutions. Below is an overview of the available modules and their primary features.
Input Module
The Input Module is designed to handle user inputs efficiently. It provides functionalities for collecting, and processing inputs from form data.
#Import the library.
from cw_rpa import Input
#Initialize the module.
input = Input()
#Calling the input method.
input.get_value("<variable name>")
E.g.
username = input.get_value("username")
Note: If the variable is missing, it defaults to None.
Logger Module
The Logger Module offers advanced logging capabilities, making it easier to track the execution flow, debug issues, and maintain operational records.
#Import the library.
from cw_rpa import Logger
#Initializing the logger
log = Logger()
#Call log method to log in Result.txt
#To log an info message
log.info("Logging info statement")
#To log an error message
log.error("Logging error statement")
#To log an exception message
log.exception("Logging exception statement")
Additionally, it supports logging warnings, critical and fatal into Result.txt
Note: A fatal log will exit the program.
#Call log method to log in result.json
#To log success message
log.result_success_message("log success message")
#To log failure message
log.result_failed_message ("log failed message")
Additionally import ResultLevel
from cw_rpa import Logger,ResultLevel
and use result_message to update the message level on result.json
SUCCESS
FAILED
ERROR
INFO
WARNING
log.result_message(ResultLevel.SUCCESS,"message")
log.result_message(ResultLevel.FAILED,"message")
log.result_message(ResultLevel.ERROR,"message")
log.result_message(ResultLevel.INFO,"message")
log.result_message(ResultLevel.WARNING,"message")
#Call result_data to log the values into the data field in result.json which is used by workflow.
data_to_log = {"<key>" : <value>} #data_to_log is a json object
log.result_data(data_to_log)
HttpClient Module
The HttpClient Module simplifies interactions with web services. It provides a straightforward way to send HTTP requests and handle responses. It Support for various HTTP methods (GET, POST, PUT, DELETE, etc.) and provides mechanisms for managing authentication tokens, essential for interacting with secured APIs.