Skip to main content

UiPath Cloud client Python package that uses the requests library

Project description

uipathlib

Package Description

UiPath Cloud client Python package that uses the requests library.

[!IMPORTANT] This packages uses pydantic~=1.0!

Usage

from a script:

import uipathlib

url_base = "https://cloud.uipath.com/my_company/Production/orchestrator_/"
client_id = "ABX"
refresh_token = "ABD"
scope = "OR.Folders.Read OR.Jobs OR.Queues OR.Execution.Read OR.Robots.Read OR.Settings.Read"
fid = "1138055"  # Folder ID (Organization ID)

uipath = uipathlib.UiPath(url_base=url_base,
                          client_id=client_id,
                          refresh_token=refresh_token,
                          scope=scope)
# ASSETS
response = uipath.list_assets(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# BUCKETS
response = uipath.list_buckets(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
response = uipath.create_bucket(fid=fid,
                                name="Test 1",
                                guid="f7ea20e9-971b-4c23-9979-321178a68c46",
                                description="Test description 1")
if response.status_code == 201:
    print("Bucket created successfully")
bid = "69248"  # bucked id example
response = uipath.delete_bucket(fid=fid, id=bid)
if response.status_code == 204:
    print("Bucket deleted successfully")
# UPLOAD
bid = "69243"  # bucked id example
response = uipath.upload_bucket_file(fid=fid,
                                     id=bid,
                                     localpath=r"C:\Users\admin\Desktop\my_bucket_demo.txt",
                                     remotepath=r"my_bucket_demo.txt")
if response.status_code in [200, 201]:
    print("File uploaded successfully")
# DELETE
bid = "69243"  # bucked id example
response = uipath.delete_bucket_file(fid=fid,
                                     id=bid, 
                                     filename=r"my_bucket_demo.txt")
if response.status_code == 204:
    print("File deleted successfully")
# CALENDARS
response = uipath.list_calendars(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# ENVIRONMENTS (UNDER DEVELOPMENT)
response = uipath.list_environments(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# JOBS
# Filter examples:
# - "State eq 'Running'"
# - "State eq 'Successful' and ReleaseName eq 'ReleaseNameOrProcessName'"
# - "ReleaseName eq 'ReleaseNameOrProcessName'"
response = uipath.list_jobs(fid=fid, filter="State eq 'Running'")
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
process_key = "ead3e825-7817-426d-8b1d-3991e6eb2809"  # example process key
robot_id = None  # None for default robot, or specify robot ID
response = uipath.start_job(fid=fid,
                            process_key=process_key,
                            robot_id=robot_id)
if response.status_code == 201:
    print(response.content)
# MACHINES
response = uipath.list_machines(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    print(df)
# PROCESSES
response = uipath.list_processes(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# QUEUES
response = uipath.list_queues(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
response = uipath.list_queue_items(fid=fid, 
                                   filter="QueueDefinitionId eq 317460")
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
queue_item_id = 1125058579  # example queue item id
response = uipath.get_queue_item(fid=fid,
                                 id=queue_item_id)
if response.status_code == 200:
    df = pd.DataFrame([response.content])
    display(df)  # print(df)
queue_name = "RPA_1201_..."  # queue name example
response = uipath.add_queue_item(fid=fid,
                                 queue=queue_name,
                                 data={"EmployeeId": "12345",
                                       "RowId": "566829607423876",
                                       "State": "Approved",
                                       "RequestId": "LR00001",
                                       "Language": "English"},
                                 reference="12345",
                                 priority="Normal")
if response.status_code == 201:
    print(response.content)
queue_name = "RPA_1201_..."  # queue name example
queue_item_id = 913233204  # example queue item id
response = uipath.update_queue_item(fid=fid,
                                    queue=queue_name,
                                    id=queue_item_id,
                                    data={"EmployeeId": "54321",
                                          "RowId": "566829607423876",
                                          "State": "Approved",
                                          "RequestId": "LR20001",
                                          "Language": "English"})
if response.status_code == 200:
    print("Queue item updated successfully")
queue_item_id = 913233204  # example queue item id
response = uipath.delete_queue_item(fid=fid,
                                    id=queue_item_id)
if response.status_code == 204:
    print("Queue item deleted successfully")
# RELEASES
response = uipath.list_releases(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# ROBOTS
response = uipath.list_robots(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
response = uipath.list_robot_logs(fid=fid, filter="JobKey eq a111d111-b111-1f11-b11d-111adac1111d")
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    print(df)
# ROLES
response = uipath.list_roles()
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# SCHEDULES
response = uipath.list_schedules(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)
# SESSIONS
response = uipath.list_sessions(fid=fid)
if response.status_code == 200:
    df = pd.DataFrame(response.content)
    display(df)  # print(df)

Installation

Install python and pip if you have not already.

Then run:

pip install pip --upgrade

For production:

pip install uipathlib

This will install the package and all of it's python dependencies.

If you want to install the project for development:

git clone https://github.com/aghuttun/uipathlib.git
cd uipathlib
pip install -e ".[dev]"

To test the development package: Testing

License

BSD License (see license file)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uipathlib-0.0.8.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uipathlib-0.0.8-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file uipathlib-0.0.8.tar.gz.

File metadata

  • Download URL: uipathlib-0.0.8.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uipathlib-0.0.8.tar.gz
Algorithm Hash digest
SHA256 8c20e775a2ae205d1785b4b72a587f311d0da391ed996e92ee394169a8dc8ca7
MD5 9a10009b2fadc1508b8334a29b82c626
BLAKE2b-256 a232f5de57f59c69a422124b4842a89df6f3d64a7cf6ceae149037eb3128c987

See more details on using hashes here.

File details

Details for the file uipathlib-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: uipathlib-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uipathlib-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 93fc6e87f3c1c369237b8aab068d2a679b281df43044bc35b3b26637c69f9615
MD5 1b02cf21f5dbc358a7f692b79890d445
BLAKE2b-256 56c932a387633bba572d32452925eaf684cadbe9e24e635816caad189dacbed7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page