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
-
Clone this repository:
git clone https://github.com/vinicinhus/botcity-rpa-template.git cd botcity-rpa-template
-
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
-
-
Set up your environment variables in a
.envfile:SERVER_MAESTRO="your_maestro_server_url" LOGIN_MAESTRO="your_maestro_login" KEY_MAESTRO="your_maestro_key"
-
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.
-
Modify
bot.pyorsrc/main.pyto 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
--environmentflag to specify the execution environment (maestroorlocal). - Bot Details: Set the bot name, server credentials, and Telegram group in
bot.pyor via environment variables. - Logs Directory: Logs are stored in the
logsfolder by default but can be customized.
How It Works
-
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.
-
Resource Tracking:
- Logs CPU, RAM, and GPU usage during execution for analysis and debugging.
-
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
logsdirectory. - 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:
-
Implement your custom automation logic in
src/main.py. -
Add or modify utility classes such as
BotRunnerLocalorBotRunnerMaestro. -
Use the
_execute_bot_taskmethod to define task-specific behavior.
Contributing
- Fork this repository.
- Create a feature branch.
- Make your changes.
- Commit and push your changes.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d94d9469670194994648bef11da584e5c7d6e7a1406e6fcbf20ef8399d0db5
|
|
| MD5 |
61d5e6970ca61633c54d1cd902e2f792
|
|
| BLAKE2b-256 |
b1b854b2a389ab428ae5ebb05f0418aea35e11638b7403970c1c4bed01cf41e5
|
File details
Details for the file botcity_rpa_template-0.1.1-py3-none-any.whl.
File metadata
- Download URL: botcity_rpa_template-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b711a8537a45b2cf2bed6e1bd6f81d50468a37f6920ff7c53b960a5b5b89243
|
|
| MD5 |
b6eb4306bf86e8ddec34b4499d6af48b
|
|
| BLAKE2b-256 |
0eabc3d606cc93bf8936fa2351ab125f1eb31321b7c1e3f68d6fd970e2118764
|