This code snippet demonstrates how to digitize, classify, validate, and extract documents using UiPath Document Understanding API's.
UiPath Document Understanding offers standalone capabilities, allowing integration with external tools and systems through APIs. This release includes APIs for Discovery, Digitization, Classification, Extraction, and Validation. Please take a look at the Official Documentation.
- Python 3.11.6
requests
librarypython-dotenv
library
-
Clone the repository to your local machine:
git clone https://github.com/nvpnathan/DU-Cloud-APIs.git
-
Navigate to the project directory:
cd DU-Cloud-APIs
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your environment variables by creating a
.env
file in the root directory and adding the following variables:
APP_ID=
APP_SECRET=
AUTH_URL=https://cloud.uipath.com/identity_/connect/token
BASE_URL=https://cloud.uipath.com/<Cloud Org>/<Cloud Tenant>/du_/api/framework/projects/
PROJECT_ID=00000000-0000-0000-0000-000000000000
-
Place the documents you want to process in the specified folder (
Example Documents
by default). -
Run the main script
main.py
to process the documents:python main.py
-
Monitor the console output for processing status and any errors.
-
Extracted results will be printed to the console and saved in CSV format in the same folder as the processed documents.
The project structure is organized as follows:
DU-Cloud-APIs/
│
├── main.py # Main script for document processing
├── auth.py # Authentication class for obtaining bearer token
├── digitize.py # Digitize class for initiating document digitization
├── classify.py # Classify class for document classification
├── extract.py # Extract class for document extraction
├── validate.py # Validate class for document validation
├── result_utils.py # Utility classes for printing and writing extraction results
│
├── .env.example # Example environment variables file
├── requirements.txt # List of dependencies
├── Generative Prompts/ # Folder containing Extraction and Classification Prompt Templates
├── Example Documents/ # Folder containing example documents
└── Output Results/ # Folder containing the CSV's of the Document Extraction Results
- Write Tests