Skip to main content

thoughtful is a collection of open-source libraries and tools for Robot Process Automation (RPA) development. The goal of this project is to provide a set of for supervising bot execution, and enabling these bots to do more.

PyPi version !Main Branch Tests Supported Versions Downloads

This project is:

Links:

thoughtful is available on PyPI and can be installed using pip:

pip install thoughtful

thoughtful officially supports Python 3.7+.


Libraries

Supervisor

Supervisor is a Workflow Engine for Digital Workers that constructs and broadcasts a detailed and structured telemetric log, called the Run Report.

Detailed documentation

Detailed documentation on how to utilize Supervisor can be found here.

from thoughtful.supervisor import step, step_scope, supervise, set_step_status


# using the step decorator
@step("2")
def step_2(name: str) -> bool:
    print(f'Hello {name}')
    return True  # some condition

def main() -> None:
    # using the step_scope context manager
    with step_scope('1') as step_context:
        try:
            print("Getting credentials")
            # ...
        except Exception as e:
            # set step status using method
            step_context.set_status("warning")

    if not step_2():
        # set step status using function
        set_step_status("2", "fail")

if __name__ == '__main__':
    with supervise():
        main()

Screen Recorder

The ScreenRecorder library facilitates the recording of screen activity from a programmatic browser session and generates a video file of the recorded session.

Detailed documentation

Detailed documentation on how to utilize Supervisor can be found here.

Prerequisites

Ensure you have already downloaded FFmpeg as it is utilized to create the video recording.

https://www.ffmpeg.org/download.html

Installation

Install the optional screen-recorder extras

Poetry

poetry install -E screen-recorder

Pip

pip install thoughtful[screen-recorder]

Usage

WARNING: It is essential that you call end_recording at the end of a recording.

If you do not call end_recording, the recording threads will continue to run until your program ends and a video will not be created.

from thoughtful.screen_recorder import ScreenRecorder, BrowserManager
from RPA.Browser.Selenium import Selenium # This dependency must be installed separately

class YoutubeScraper(ScreenRecorder):
    def __init__(self) -> None:
        self._selenium_instance = Selenium()
        super().__init__(browser_manager=BrowserManager(instance=self._selenium_instance))

youtube_scraper = YoutubeScraper()
try:
    # ... Perform actions here ...
finally:
    if youtube_scraper:
        # We recommend calling `end_recording` in a `finally` block to ensure that
        # video processing occurs and all recording threads are terminated even if the Process fails
        youtube_scraper.end_recording()

Contributing

Contributions to thoughtful are welcome!

To get started, see the contributing guide.


Made with ❤️ by

Thoughtful


This project is open-source and licensed under the terms of the Apache License 2.0.

Metadata

Release files for thoughtful-temp-test-package 2.8.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thoughtful-temp-test-package 2.8.0.2
File Size Uploaded
thoughtful_temp_test_package-2.8.0.2.tar.gz 38.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thoughtful-temp-test-package 2.8.0.2
File Interpreter ABI Platform
thoughtful_temp_test_package-2.8.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 85.9 kB

Release files / thoughtful_temp_test_package-2.8.0.2.tar.gz

Download URL thoughtful_temp_test_package-2.8.0.2.tar.gz
Size 38.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b200246519b9d340aa92543ba28cd16e336ea697f6b6c7ecbeadcc4e5fc14e9c
BLAKE2b-256 checksum
How to use checksums
50ff46d27551dae1f6c69986ed389f5f0c2e140cb86d06e1cff8f6c79ae1ea29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

Release files / thoughtful_temp_test_package-2.8.0.2-py3-none-any.whl

Download URL thoughtful_temp_test_package-2.8.0.2-py3-none-any.whl
Size 47.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17e086db65e5d812b8991e41f6b7cea4462ebbbfce32ea210fa453029a3e4063
BLAKE2b-256 checksum
How to use checksums
7d8192c3359ee036bae509899864139c4a0c319adddfdd5bb6de65f7cd7c221b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

2.8.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page