Assume I have a class in python:
def __init__(self, arg1, arg2):
self.arg1 = arg1
self.arg2 = arg2
print arg1, arg2
test = TestClass('ARG1', 'ARG2')
To import the library with arguments, just add them after the library name:
Library TestClass ARG1 ARG2
So the "import" and the instantiation are done in one shot. Now, the thing that can be tricky is to understand the scope of your instance. This is well explained in the User Guide section "Test Library Scope":
A new instance is created for every test case. [...] This is the default.
Note that if you want to import the same library several times with different arguments, and hence have difference instances of your classes, you will have to name them on import:
Library TestClass ARG1 ARG2 WITH NAME First_lib Library TestClass ARG3 ARG4 WITH NAME Second_lib
And then in your tests, you have to prefix the keywords:
*** Test Cases *** MyTest First_lib.mykeyword foo bar Second_lib.mykeyword john doe
This is explained in this section of the User Guide.