Obviously it is possible to import Python Robot Framework library in some Python script. However, is there a magic way to import Robot Framework resource file in Python script? Resource files are written in RF syntax so there would need to be some dedicated Python module for importing it (translating RF syntax to Python actually). Perhaps something like this exists already or even some RF builtin module could be used, as if I understand correctly, during script execution RF syntax is translated to Python calls.
Update 2018-06-18:
As suggested by A. Kootstra it is possible to import Robot keyword inside Python script using:
from robot.libraries.BuiltIn import BuiltIn
BuiltIn().import_resource('${EXECDIR}/resource.robot')
However, how can I access any keyword from imported Robot resource inside Python script ? BuiltIn().import_resource does not return any handler to imported lib.
I would call
BuiltIn.call_method
but it needs object instance as first parameter. Imported resource file is also not present in a dict returned by
globals()