CW RPA Library

1.2.2 · active · verified Sun Apr 12

The `cw-rpa` package is a Python library providing reusable functions and common utilities specifically designed for developing Robotic Process Automation (RPA) bots. It offers modules for handling user inputs, logging, and interacting with web services. The current version is 1.2.2, released on October 12, 2025, and appears to have a regular release cadence based on the PyPI history.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the usage of the `Input`, `Logger`, and `HttpClient` modules. It shows how to retrieve an input value (simulated via an environment variable), log informational and error messages, and make a simple HTTP GET request using the `HttpClient` for web service interaction.

from cw_rpa import Input, Logger, HttpClient
import os

# Initialize modules
input_handler = Input()
logger = Logger()
http_client = HttpClient()

# Example: Get an input value (simulating environment variable or form data)
username = os.environ.get('RPA_USERNAME', 'default_user')
logger.info(f"Retrieved username: {username}")

# Example: Send an HTTP GET request (replace with a real endpoint)
try:
    # Using a placeholder URL for demonstration
    test_url = "https://jsonplaceholder.typicode.com/posts/1"
    response = http_client.third_party_integration("example_integration").get(url=test_url)
    logger.info(f"HTTP GET Response Status: {response.status_code}")
    logger.info(f"HTTP GET Response Body: {response.json()}")
except Exception as e:
    logger.error(f"Error during HTTP request: {e}")

# Example: Log an error message
logger.error("This is an example error log.")

# Example: Log an exception (simulated)
try:
    1 / 0
except ZeroDivisionError as e:
    logger.exception(f"Caught an exception: {e}")

view raw JSON →