This code snippet demonstrates how to digitize, classify, 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.
- Rust 1.74.1
-
Clone the repository to your local machine:
git clone https://github.com/nvpnathan/RustyDU.git
-
Navigate to the project directory:
cd RustyDU
-
Install the required dependencies:
cargo build
-
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
cargo run
to process the documents: -
Monitor the console output for processing status and any errors.
-
Extracted results will be printed to the console and saved in CSV format in
output_results
folder.
The project structure is organized as follows:
RustyDU/
│
├── src/
│ ├── main.rs # Main entry point for the application
│ ├── auth.rs # Authentication module for obtaining bearer token
│ ├── digitize.rs # Digitize module for initiating document digitization
│ ├── classify.rs # Classify module for document classification
│ ├── extract.rs # Extract module for document extraction
│ ├── validate.rs # Validate module for document validation
│ └── result_utils.rs # Utility module for printing and writing extraction results
│
├── .env.example # Example environment variables file
├── Cargo.toml # Rust package configuration file
├── example_documents/ # Folder containing example documents
├── generative_prompts/ # Folder containing Extraction and Classification Prompt Templates
└── output_results/ # Folder containing the CSV's of the Document Extraction Results
- Everything
- 38 more errors