Task Object Storage package.
Project description
Transaction management for Robot Framework RPA using MongoDB.
Included are two packages: tos and TOSLibrary. The former is the actual task object storage implementation written in pure Python, without any Robot Framework dependencies. TOSLibrary is a Robot Framework keyword library built on top of tos. It is built as a lightweight dynamic proxy library, so all the changes in tos are immediately available in TOSLibrary keywords.
Quickstart guide
Requirements
MongoDB (version >4)
Python (version >3.6)
Installation
Latest stable version from PyPi with pip:
pip install task-object-storage
Latest development version from PyPi:
pip install task-object-storage --pre
Usage
You can import TOSLibrary into your Robot Framework suite with
*** Settings ***
Library TOSLibrary ${db_server}:${db_port} ${db_name}
If you are using authentication in MongoDB, you can pass credentials:
*** Settings ***
Library TOSLibrary ${db_server}:${db_port} ${db_name} ${db_user} ${db_passw}
You can also add a suffix to the collection name. By passing a valid collection_suffix argument to TOSLibrary, you can create a collection with a name task_objects.your_suffix
*** Settings ***
Library TOSLibrary ${db_server}:${db_port} ${db_name} ${db_user} ${db_passw} ${collection_suffix}
It is also possible to separate payloads of task objects to their own collection, and also optionally set a lifetime for them. See the full API documentation for further reference.
After initialization, the keywords are callable from Robot Framework.
This library instance can also be accessed inside Python keywords with
from robot.libraries.BuiltIn import BuiltIn
toslib = BuiltIn().get_library_instance("TOSLibrary")
toslib.keyword_name
The keywords can be also called with:
BuiltIn().run_keyword("<keyword name>")
To use task object storage in Python without any Robot Framework dependencies you should use tos package directly:
from tos.task_object_storage import TaskObjectStorage
tos = TaskObjectStorage(
db_server=server,
db_name=db_name,
db_user=db_user,
db_passw=db_passw,
)
If db_user and db_passw are empty strings, TaskObjectStorage will default to using no authentication.
Available keywords
See the full API documentation.
For developers
Release a new version by running:
scripts/build.sh release
You can also install the whl package found in the dist directory with
pip install <package-name>.whl
or put inside requirements.txt:
file:C:/path/to/<package-name>.whl # on windows
file:/path/to/<package-name>.whl # on linux
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for task_object_storage-1.1.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1277df5c3e4ca38c2b80852080cb352b848fda843129219aca39983f63122b0a |
|
MD5 | 59da30a6136b2f1067cce626b6d2aa6d |
|
BLAKE2b-256 | 2cb370a14ed04588659d1510bf6b9b90d58bd4753fc78093363b95453d28a1d3 |