- Python 3.10 or higher
piporuvpackage manager- A UiPath Platform account with appropriate permissions
We recommend using uv for package management. To create a new project:
mkdir example
cd example
uv init . --python 3.10This command creates a basic project structure.
Add the UiPath SDK to your project:
uv add uipathTo verify the installation, run:
uv run uipath --versionTo debug your script locally and publish your project, you need to authenticate with UiPath:
uv run uipath authThis command opens a new browser window. If you encounter any issues, copy the URL from the terminal and paste it into your browser. After authentication, select your tenant by typing its corresponding number in the terminal.
After completing this step, your project will contain a .env file with your access token, UiPath URL, and other configuration details.
First, open .env in your code editor and specify the folder where you want to run the code. For example, to use the "Shared" folder:
UIPATH_FOLDER_PATH=SharedOpen main.py in your code editor and add the following code:
from uipath import UiPath
def main():
sdk = UiPath()
sdk.processes.invoke(
"test-pack",
input_arguments={
"message": "Hello, World!",
"repeat": 3,
"prefix": "[Echo]"
}
)Note::
test-packis the name of the process we created from the previous package.
Open your browser and navigate to UiPath. Go to the specified folder, and you'll see a new job for test-pack has been executed. The output will be:
[Echo]: Hello, World! Echo: Hello, World! Echo: Hello, World!