SDK (python)
Labii SDK
Last updated
Labii SDK
Last updated
SDK is the toolkit with prebuilt Labii components that developers use to interact with Labii APIs. Full documentation available at
Install the Labii SDK
2. Import the package
3. Initial the API object
4. Start querying
During SDK initiation, the following parameters can be customized:
base_url
, the server base URL, defaults to . If you are using a different data center, make sure to change the base_url
setting.
api_key
, the API Key to get authenticated.
organization__sid
, your organization sid. You can find it by logging into Labii () and going to Side menu -> Settings -> Organization -> Sid
api,
the APIObject. If a new APIObject is not provided, it will be automatically created. Utilize this functionality when you require authentication for the API before initializing a Labii Object.
Profile
APIKey
Organization
Application
Subscription
People
Team
SAML
OrganizationWidget
Backup
Project
ProjectMember
Table
Column
Section
Filter
Record
Cell
Version
Visitor
Activity
Workflow
Step
Widget
Dashboard
Notification
A list of methods for interacting with objects.
Create a object.
query
(optional), additional query to limit the results.
Return a object
sid
, the sid of the object
query
(optional), additional query to limit the results.
Get a list of objects
page
(default=1), the page number to return.
page_size
(default=10), the number of items to be paginated.
all_pages
(bool, default=False), Whether all pages should be returned. When False, only return the data for the first page. Only applies to list views.
name, return only sid and name, very fast
list, return selected fields of the objects, fast
detail, return all fields of the objects, slow
query
(optional), additional query to limit the results.
Edit an object
sid
, the sid of the object
query
(optional), additional query to limit the results.
Remove an object
sid
, the sid of the object
query
(optional), additional query to limit the results.
Labii also developed a few functions to facilitate the file uploading.
Upload a file to Labii
file_path
, the full file path
projects
, list of projects in the format of [{"sid": "project__sid"}]
You can use this function to watch a particular folder. As soon as the file(s) are present, the function will upload each file to Labii and move the file to the "uploaded" subfolder. This function allows you to upload files generated by a machine/equipment automatically.
folder_path
, required, the folder (including the path) to watch. default to current path.
projects
, required, list of projects in the format of [{"sid": "project__sid"}]
interval
, optional, time interval to check the folder, default to 5 seconds.
Utilize this function for seamlessly transitioning between various organizations. This will prove especially advantageous when transitioning from a test organization to a production organization.
When you're in the process of generating a new record, it's frequently necessary to have the column SID in order to prepare the data object. In Python, obtaining the index of an object in an array isn't always a straightforward task. This is why we have developed this function to simplify the coding process when working with the Labii SDK.
Labii objects for interaction. Learn more at
data
(dict), a JSON dict data to post. Learn more at
level
(default to "organization"), the scope of records to retrieve. Learn more at
serializer
(default to "list"), the scope of fields of the return data. Learn more at
data
(dict), a JSON dict data to post. Learn more at