Registry / testing / robotframework-pythonlibcore

robotframework-pythonlibcore

JSON →
library4.6.0pypypi✓ verified 25d ago

Robot Framework PythonLibCore (version 4.5.0) is a generic component designed to simplify the creation of larger, more flexible test libraries for Robot Framework using Python. It abstracts away the complexities of the Robot Framework's hybrid and dynamic library APIs, providing a streamlined interface. The library is actively maintained with frequent releases addressing bug fixes, performance enhancements, and compatibility with new Python and Robot Framework versions. It is widely used by other popular Robot Framework libraries like SeleniumLibrary and Browser library.

pip install robotframework-pythonlibcore
INSTALL
IMPORT
SIG · ROBOTFRAMEWORK-PYT
R
robotframework-pythonlibcore
testingpythonv4.6.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DynamicCore
from robotlibcore import DynamicCore
from robotlibcore import DynamicCore

This example demonstrates creating a Robot Framework test library using `DynamicCore` from `robotlibcore`. It defines two separate classes (`LibraryComponent1`, `LibraryComponent2`) that contain keywords, decorated with `@keyword`. These components are then passed to the `DynamicCore`'s constructor in the main `MyLibrary` class. It also shows a keyword directly implemented in the main library class.

from robotlibcore import DynamicCore, keyword class LibraryComponent1: @keyword def my_first_keyword(self, arg): print(f"Executing My First Keyword with: {arg}") return f"Processed: {arg}" class LibraryComponent2: @keyword('Custom Name Keyword') def another_keyword(self, value): print(f"Executing Another Keyword with value: {value}") return f"Custom handled: {value}" class MyLibrary(DynamicCore): """Example Robot Framework library using PythonLibCore.""" ROBOT_LIBRARY_SCOPE = 'TEST SUITE' def __init__(self): # Pass instances of classes containing keywords to DynamicCore libraries = [LibraryComponent1(), LibraryComponent2()] DynamicCore.__init__(self, libraries) @keyword def keyword_in_main_library(self, data): """A keyword directly in the main library class.""" print(f"Keyword in main library received: {data}") return data.upper() # To use this library in Robot Framework: # *** Settings *** # Library MyLibrary.py # # *** Test Cases *** # Example Test # ${result1}= My First Keyword hello # Log To Console ${result1} # ${result2}= Custom Name Keyword world # Log To Console ${result2} # ${result3}= Keyword In Main Library pythonlibcore # Log To Console ${result3}
Debug
Known issues
breakingPython 3.7 support was dropped in PythonLibCore v4.2.0. Users on Python 3.7 must either upgrade their Python version or use an older version of `robotframework-pythonlibcore`.
fix
Upgrade to Python 3.8 or newer, or pin `robotframework-pythonlibcore` to `<4.2.0`.
affects: >=4.2.0
breakingMajor Robot Framework versions require specific `pythonlibcore` compatibility. For instance, v3.0.0 dropped support for Robot Framework 3.1 and addressed issues with Robot Framework 4 and `typing.Union`. Version 4.3.0 added support for Robot Framework 7.0, and v4.5.0 supports Robot Framework 6.1 and newer.
fix
Always check the release notes for `robotframework-pythonlibcore` to ensure compatibility with your Robot Framework version. Upgrade or downgrade `robotframework-pythonlibcore` as needed.
affects: All versions
gotchaPrior to v4.4.1, a bug could cause custom keyword names defined via the `@keyword` decorator to 'leak', potentially leading to unexpected keyword resolution or conflicts.
fix
Upgrade to `robotframework-pythonlibcore` version 4.4.1 or newer to avoid this issue.
affects: <4.4.1
gotchaIncorrect library import paths in Robot Framework are a common source of 'No keyword with name X found' errors. When importing a Python class-based library, ensure the import path correctly points to the module or class.
fix
If your library is in `mylibrary.py` and the class is `MyLibrary`, import it as `Library    mylibrary.MyLibrary` or ensure `mylibrary.py` is directly in the Python module search path and can be imported as `Library    mylibrary` (where the module's `__init__.py` or the module itself exposes `MyLibrary`).
affects: All versions
gotchaWhen developing a dynamic library with PythonLibCore, prefer inheriting `DynamicCore` (or `HybridCore`) and using the `@keyword` decorator on methods within your component classes. Avoid manually implementing `get_keyword_names()` and `run_keyword()` if you are using PythonLibCore's keyword discovery mechanism, as this can lead to keywords not being registered or found.
fix
Let `DynamicCore` handle keyword discovery by decorating methods with `@keyword` and passing component instances to `DynamicCore.__init__`.
affects: All versions
gotchaVersion 4.5.0 includes a bug fix to avoid 'maximum recursion depth exceeded' errors on `getattr`. If you encounter this error in older versions, it might be related to this known issue.
fix
Upgrade to `robotframework-pythonlibcore` version 4.5.0 or newer.
affects: <4.5.0
Upgrade
Version history
4.6.0latest on PyPI · released May 14, 2026
Audit
Dependencies
robotframeworkrequiredCore dependency for developing Robot Framework test libraries. Supports Robot Framework 6.1 and newer since version 4.5.0, and Robot Framework 7.0 since version 4.3.0.
typing-extensionsrequiredDirect dependency for backported and experimental type hints.
wraptrequiredDirect dependency for decorators, wrappers and monkey patching.
Agent activity
21 hits · last 30 days
node
18
Bingbot
1
Resources
robotframework-pythonlibcore — pip install robotframework-pythonlibcore · libregistry