Loading

Developer Documentation

Learn how to build, schedule, and scale your Python automations on CyberOak v2.0.

Platform Overview

CyberOak is a cloud-native RPA platform that runs standard Python scripts. Unlike traditional RPA that relies on visual recorders, CyberOak gives you full code-level control.

Core Philosophy: Upload a .py file, map your inputs (Secrets/Files), and let us handle the infrastructure, logging, and alerts.

The Automation Workflow

1. Develop

Write your script locally. Test using standard libraries.

2. Configure

Upload to CyberOak. Map variables in the UI and upload any necessary input files (Excel, Configs).

3. Execute

Trigger via CRON schedule or on-demand. Output files are automatically captured and saved.

4. Notifications

Get notified when execution is complete.

Python Runtime Environment

Your robots execute in an isolated sandbox environment.

  • Python Version 3.11.7
  • Operating System Linux (Debian/Ubuntu based)

Handling Inputs & Secrets

Avoid hardcoding sensitive data. CyberOak provides two ways to inject data into your script at runtime.

1. Environment Variables (Secrets)

Defined in the "secrets" tab of your robot. Securely encrypted.


# Access a secret defined in the UI
db_password = parameters.get('ORACLE_DB_PASS')
2. Runtime Variables

Defined in "Parameters" section. Useful for dynamic parameters.

# 'inputs' is a global dictionary available in the runtime
target_email = inputs.get('notification_email')

Built-in Helper Functions

The platform exposes specific utility functions globally to simplify common tasks like saving reports or generating PDFs.

save_file(filename, content)

Saves a generated file to the execution results. It automatically links the file to the automation run.

# 1. Saving simple text/JSON
import json
data = {"status": "success", "processed": 50}
save_file("log.json", json.dumps(data))

# 2. Saving an in-memory Excel file (using BytesIO)
from io import BytesIO
from openpyxl import Workbook

wb = Workbook()
ws = wb.active
ws['A1'] = "Report Data"
buffer = BytesIO()
wb.save(buffer)
save_file("Weekly_Report.xlsx", buffer)
generate_pdf(template_file, context_dict)

Generates a PDF binary from an uploaded HTML template using xhtml2pdf.

# template_file: Name of the HTML file uploaded in 'File Inputs'
# context_dict: Data to inject into the template

context = {"user_name": "Alice", "date": "2025-01-01"}
pdf_bytes = generate_pdf("invoice_template.html", context)
save_file("Invoice_Alice.pdf", pdf_bytes)
executor.map(func, iterable)

Run CPU-intensive tasks across multiple worker processes.

def heavy_calc(x):
    return x * x

# Automatically distributes work
results = list(executor.map(heavy_calc, range(1000)))

Database Connectivity

Firewall Rule Required: To ensure your script can connect, you must whitelist the CyberOak domain www.cyber-oak.com in your database's "Allowed Hosts" settings.

We support the following adapters out of the box:

  • PostgreSQL: psycopg2 (v2.9.11)
  • Oracle: oracledb (v3.4.1)
  • MySQL: mysqlclient (v2.2.7)

Pre-installed Libraries

No pip install required. The following libraries are available in the environment:

Web & Scraping
LibraryVersionUse Case
requests2.32.3HTTP REST API clients
selenium4.38.0Browser automation & scraping
beautifulsoup44.14.3HTML/XML Parsing
scrapy2.13.4Web crawling framework
zeep4.3.2SOAP / WSDL clients
Data Processing & Office
LibraryVersionUse Case
pandas2.3.3Data analysis
numpy2.2.6Numeric arrays
polars1.35.2High-performance DataFrames
openpyxl3.1.5Excel (XLSX) manipulation
pdfplumber0.11.8PDF text extraction
xhtml2pdf0.2.17HTML to PDF generation
Utilities & Cloud
LibraryVersionUse Case
boto31.38.17AWS SDK
paramiko4.0.0SSH & SFTP
opencv-python4.12.0Image processing
Pillow (PIL)12.0.0Image manipulation
smtplibBuilt-inSending emails

Coding Guidelines

  • Validation: Raise ValidationError for recoverable issues rather than crashing with exit(1).
  • Logging: Use the standard logging module. All stdout/stderr is captured in the Orchestrator logs.
  • Paths: Do not rely on absolute paths like C:/Users/.... Use relative paths or the temporary directory.