Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

RALF Python SDK

Website GitHub license GitHub issues PyPI Python Versions Requirements Status

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

Disclaimer! This package is in development stage (unstable), it may be potentially buggy

Installation

Using Python Package Index (PyPI)

pip3 install rallf

From source

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

Getting started (hello bot-task)

In order to get started with robot task development, just run python3 -m rallf-cli create-project "hello" and it will create a basic project with the files explained below.

hello.py

# File: hello.py

from rallf import Task

'''
  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(Task):

    # implementing self.run is required for tasks, not for skills
    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 cli)

Run run method using the CLI

python3 -m rallf-cli run . -f run

Run run method using the jsonrpc api

echo '{"jsonrpc": "2.0", "id": 1, "method": "delegate_local", "params": {"routine": "run", "args": {}}}' | python3 -m rallf-cli run .

Get help

python3 -m rallf-cli -h

Extended usage

Task Manifest

Task manifest is mandatory for rallf.com tasks, but not necessary for developing, visit manifest reference to learn more in-deep about task manifests.

/* File manifest.json */
{
  "title": "Hello Task",
  "description": "This tasks logs hello and returns the <title> of github.com",
  "long-description": "@README.md",
  "fqtn": "com.example.hello",
  "type": "task", /* choices: task, skill */
  "main": "hello.Hello",
  "exports": ["run"], /* default: ["run"] */
  "devices": ["firefox"],
  "skills": [],
  "permissions": {
    "uris": ["https://github.com", "https://google.com"],
    "devices": ["firefox", "chrome"],
    "skills": {
      "com.example.facebook": ["likePage", "likePost"],
      "com.example.gmail": ["search", "likePost"]
    },
  }
}

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 (ITC)

  • Call other tasks from the market (rallf.com)
  • Use robot skills

Task lifecycle callbacks

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

Task vs Skill

A common question is the difference between Task and Skill inside the RALLF ecosystem, the main difference is that Tasks only have one method called run and the skill can have many, so technically a Task is a subtype of Skill, and also a Skill can implement the run method and can be used as Task too.

Metadata

Release files for rallf 0.1.26.dev102

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rallf 0.1.26.dev102
File Size Uploaded Provenance Actions
rallf-0.1.26.dev102.tar.gz 12.7 kB Without provenance Details for rallf-0.1.26.dev102.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rallf 0.1.26.dev102
File Interpreter ABI Platform Actions
rallf-0.1.26.dev102-py3-none-any.whl Python 3 none any Details for rallf-0.1.26.dev102-py3-none-any.whl

Total release size: 30.4 kB

Release files / rallf-0.1.26.dev102.tar.gz

Download URL rallf-0.1.26.dev102.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
720eb0f4bb7b55458a24a64d6eb7733ee7dc24fb88fc7a1cf8047c6f67e2ed15
BLAKE2b-256 checksum
How to use checksums
8e970b4f2002e2e912258e7fdb3f9187a57d615522d42528649b5f1f7b537818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.3

Release files / rallf-0.1.26.dev102-py3-none-any.whl

Download URL rallf-0.1.26.dev102-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21ce310cb906b8fcc04d6e17785a818adbeb9a8b493daf3a6a60156c47bc4b23
BLAKE2b-256 checksum
How to use checksums
c650153ff00b641b9142dee88639a52b40ac990f9f1eb7d0c779c336d0f15a06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.3

Security for rallf 0.1.26.dev102

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page