Installation and Setup¶
Prerequisites¶
- Python 3.7+ with
pipavailable in the terminal. - Git installed, since the project is generated from the public BeaPro repository.
- BotCity account, required only to run with Orchestrator integration.
Install the Framework¶
BeaPro is distributed as a Cookiecutter template. Instead of cloning the repository, you generate a new project from it, with your bot's name already applied to folders and files.
1. Install Cookiecutter¶
2. Generate the Project¶
In the terminal, go to the folder where the project should be created and run:
Cookiecutter asks for the bot name in the bot_id field. Enter a descriptive name or press Enter to accept the default (BeaPro Bot Template):
Spaces in the name are replaced with _ to form the project folder name. In the example above, the project is created in my_bot/, with the following structure:
my_bot/
├── bot.py # Main automation orchestration
├── framework/ # Core framework modules
│ ├── state.py # State management and BotCity SDK setup
│ ├── exceptions.py # Custom exception classes
│ ├── datasources.py # Data source implementations (CSV, Datapool)
│ ├── process.py # Main automation logic (ADD YOUR CODE HERE)
│ ├── initialize.py # Initialization and setup
│ ├── finalize.py # Cleanup and finalization
│ ├── status_handling.py # Exception and success handlers
│ └── logger.py # Logging configuration
├── requirements.txt # Python dependencies
├── .env # Environment variables for testing (credentials)
├── .gitignore # Files ignored by Git
├── resources/ # Automation support files (e.g. input CSV)
├── output/ # Generated output files and logs
├── temp/ # Temporary files (screenshots, etc.)
└── build/ # Build scripts
Source repository
The template source code is available at beapro-framework.
3. Create a Virtual Environment¶
We recommend isolating the project dependencies in a virtual environment. In the project folder, run:
Virtual environment folder name
Use the name venv. The project's build scripts and .gitignore already ignore this folder, which keeps it out of the package sent to the Orchestrator.
4. Install the Dependencies¶
With the virtual environment active, install the dependencies listed in requirements.txt:
This command installs the BotCity Maestro SDK, the BotCity Web framework, the CSV and Excel plugins, python-dotenv, and webdriver-manager.
5. Configure the Environment Variables¶
The .env file is created automatically when the project is generated. It is used only to run the bot locally with a connection to the Orchestrator. Fill in the fields with your account details:
- SERVER: URL of your Orchestrator.
- LOGIN and KEY: access credentials shown on the Orchestrator's Dev. Environment page.
- TASK_ID: identifier of the task to which the local execution data, such as logs, alerts, and result files, will be sent. This field is required only when you want to send data to the Orchestrator; without it, the bot runs in Test Mode. It is recommended to create a test task in the Orchestrator exclusively for this purpose. The creation procedure is described in New Task.
When .env is not needed
If any of the fields is left empty, or if the login with these credentials fails, BeaPro automatically runs in Test Mode, without a connection to the Orchestrator. On the BotCity Runner, the credentials are injected by the Runner itself and .env is ignored.
Do not commit the .env file
.env contains sensitive credentials. It is already listed in .gitignore and excluded by the build scripts. Keep it that way.
6. Configure the Data Source¶
Open framework/datasources.py and find the configuration block at the end of the file. By default, the project uses a Datapool with the label BeaPro-Datapool:
data_source = DatapoolSource("BeaPro-Datapool")
# data_source = CSVSource(r"./resources/your_file.csv")
Choose the data source that fits your scenario:
- DatapoolSource: reads items from an Orchestrator Datapool. Replace
BeaPro-Datapoolwith your Datapool's label and confirm that it is active. - CSVSource: reads items from a local CSV file. Comment out the
DatapoolSourceline, uncomment theCSVSourceline, and enter your file path. We recommend saving the CSV in theresources/folder, already used in the code example. - Custom source: create a class that inherits from
BaseSourceto read data from databases, APIs, or other sources.
Data source in Test Mode
The Datapool depends on the Orchestrator connection. To test locally without credentials, use CSVSource.
7. Validate the Installation¶
Run the bot locally to confirm that the installation is correct:
The console shows which mode the bot is running in, for example:
Installation complete
If the execution mode message appears and the bot goes through the data source items without import errors, the framework is ready. From here, add your automation logic to the process_item(item) function in framework/process.py.
Execution Modes¶
BeaPro detects the execution mode automatically:
| Mode | Description |
|---|---|
| Test Mode | Runs locally without credentials. Mock objects replace the Orchestrator features. |
| Local with Authentication | Uses the .env credentials for full Orchestrator integration. Ideal for development and debugging. |
| BotCity Runner | Deployed to the BotCity Orchestrator. Credentials are injected automatically. |
Build and Deploy the Package¶
To build the bot package, run the build script for your operating system from the project folder:
The script generates the my_bot.zip file in the project root, excluding venv, .env, temp, and output. Upload this file to the Orchestrator with Easy Deploy and create a task to run it.
Monitor the Execution¶
After the execution, check:
- Console output: execution flow and detected mode.
output/folder: log files and CSV results.temp/folder: screenshots captured on errors.- BotCity Orchestrator: automation log with the execution summary, alerts, errors with screenshots, and Result Files (when running with authentication or on the Runner).