Skip to main content

rallf.com Software Development Kit (SDK)

Project description

RALF Python SDK

RALLF SDK provides the tools to create tasks for rallf robots (rallf.com) using python3.

Installation

Using Python Package Index (PyPI)

pip3 install rallf

From source

git clone https://github.com/RobotUnion/rallf-python-sdk
cd rallf-python-sdk
python3 setup.py install

Basic usage (hello bot)

Create hello.py

# File: hello.py

import rallf

'''
  Hello task opens github and returns the title of the page upon it is loaded.
  To learn more about python selenium api, see https://selenium-python.readthedocs.io/
'''
class Hello(rallf.Task):

    # implementing self.run is required for tasks
    def run(self, input):
        # Log stuff via the available logger
        self.logger.debug('Hello Bot')

        # get a firefox instance
        browser = self.robot.devices['firefox']
        browser.get('https://github.com')
        return browser.getTitle()

Try it

rallf start hello

Extended usage

Task Manifest

Injected objects

  • self.robot: this object is injected in the task creation
  • input: this parameter is passed to the run(self, input) function

Inter-task communication (task delegates)

Task lifecycle callbacks

  • warmup(self): this optional method is executed some time before the task starts to speed-up the run function.
  • run(self, input): this required method handles the work of the task and is triggered at start of the task.
  • cooldown(self): this method is called when the task is going to be some time without use.

Project details


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
rallf-0.1.9-py3-none-any.whl (6.2 kB) Copy SHA256 hash SHA256 Wheel py3
rallf-0.1.9.tar.gz (3.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page