Skip to main content

My bot project description

Project description

BotCity RPA Automation Template

This repository provides a robust template for creating Robotic Process Automation (RPA) bots using the BotCity framework. The template includes integration with BotMaestroSDK, Telegram Bot notifications, detailed logging, and resource tracking for efficient and scalable automation tasks.

Features

  • Environment-Specific Execution: Easily switch between Maestro (--environment maestro) and local (--environment local) execution modes.

  • BotMaestroSDK Integration: Leverage BotCity Maestro for task management and artifact handling.

  • Telegram Notifications: Send real-time execution updates and upload log files to Telegram groups.

  • Detailed Resource Usage Logging: Tracks CPU, RAM, and GPU usage during bot execution.

  • Flexible Configuration: Customize bot settings such as server credentials, log directories, and Telegram groups.

Getting Started

Prerequisites

Before running the bot, ensure you have the following installed:

  • Python 3.8+
  • Poetry (for dependency management)
  • BotCity SDK (BotCity Maestro)
  • Telegram Bot Token (for bot interaction, if needed)

Installation

  1. Clone this repository:

    git clone https://github.com/vinicinhus/botcity-rpa-template.git
    
    cd botcity-rpa-template 
    
  2. Install dependencies. You can choose one of the following methods:

    • Using Poetry:

      If you are using Poetry for dependency management, run:

      poetry install
      
    • Using requirements.txt:

      Alternatively, if you prefer to use pip and a requirements.txt file, you can install the dependencies as follows:

      pip install -r requirements.txt
      
  3. Set up your environment variables in a .env file:

    SERVER_MAESTRO="your_maestro_server_url"
    LOGIN_MAESTRO="your_maestro_login"  
    KEY_MAESTRO="your_maestro_key"  
    
  4. Set up your Telegram Bot token:

    • Create a bot via BotFather on Telegram.
    • Retrieve the token and store it securely in BotCity Maestro under a credential labeled Telegram.
  5. Modify bot.py or src/main.py to include your automation logic.

Usage

To run the bot, specify the desired environment:

  • Maestro Execution (default):

    poetry run python bot.py --environment maestro
    # Or
    python bot.py --environment maestro  
    
  • Local Execution:

    poetry run python bot.py --environment local
    # Or
    python bot.py --environment local  
    

Configuration

  • Environment Selection: Use the --environment flag to specify the execution environment (maestro or local).
  • Bot Details: Set the bot name, server credentials, and Telegram group in bot.py or via environment variables.
  • Logs Directory: Logs are stored in the logs folder by default but can be customized.

How It Works

  1. Execution Modes:

    • Maestro Mode: Uses the BotMaestroSDK to execute tasks and interact with the BotCity platform.
    • Local Mode: Runs tasks locally while still providing logs and notifications via Telegram.
  2. Resource Tracking:

    • Logs CPU, RAM, and GPU usage during execution for analysis and debugging.
  3. Error Handling:

    • Sends error messages and uploads logs to Telegram and BotCity Maestro in case of failures.

Telegram Notifications

  • Notifications are sent to the configured group about bot execution status (completion and error).
  • Log files are automatically uploaded to the Telegram group for analysis.

Logs and Artifacts

Logs:

  • Generated for each execution and saved in the logs directory.
  • Includes execution time, resource usage, and errors.

Artifacts:

  • Automatically uploaded to BotCity Maestro under the associated task.

Extending the Template

To extend or modify the bot’s functionality:

  1. Implement your custom automation logic in src/main.py.

  2. Add or modify utility classes such as BotRunnerLocal or BotRunnerMaestro.

  3. Use the _execute_bot_task method to define task-specific behavior.

Contributing

  1. Fork this repository.
  2. Create a feature branch.
  3. Make your changes.
  4. Commit and push your changes.
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • BotCity for providing the powerful framework for automation.
  • Telegram Bot API for integrating with Telegram for bot interactions.
  • Poetry for managing project dependencies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botcity_rpa_template-0.1.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

botcity_rpa_template-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file botcity_rpa_template-0.1.1.tar.gz.

File metadata

  • Download URL: botcity_rpa_template-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for botcity_rpa_template-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b5d94d9469670194994648bef11da584e5c7d6e7a1406e6fcbf20ef8399d0db5
MD5 61d5e6970ca61633c54d1cd902e2f792
BLAKE2b-256 b1b854b2a389ab428ae5ebb05f0418aea35e11638b7403970c1c4bed01cf41e5

See more details on using hashes here.

File details

Details for the file botcity_rpa_template-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for botcity_rpa_template-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b711a8537a45b2cf2bed6e1bd6f81d50468a37f6920ff7c53b960a5b5b89243
MD5 b6eb4306bf86e8ddec34b4499d6af48b
BLAKE2b-256 0eabc3d606cc93bf8936fa2351ab125f1eb31321b7c1e3f68d6fd970e2118764

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page