Skip to content

A hands-on CLI tool sample showcasing the integration of Dart with Google Cloud's DocumentAI.

License

Notifications You must be signed in to change notification settings

bwnyasse/dart-documentai-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Document AI Sample CLI Tool for Dart Developers

DartDocumentAISamples is a personal initiative to showcase the capabilities of the Dart language in building applications that interact with Google Cloud services. The core of this project revolves around demonstrating how Dart can be seamlessly integrated with Google Cloud's DocumentAI. As a hands-on example, it provides Dart developers with practical insights into processing, managing, and leveraging DocumentAI's powerful features within a Dart-centric workflow. Please note that this is a work-in-progress, and contributions to enhance its offerings are warmly welcomed. For a glimpse of the roadmap, refer to the TODOs section below.

What is DocumentAI?

DocumentAI is a suite of tools provided by Google Cloud that harnesses the power of machine learning to help organizations automate document processing. It can efficiently parse, structure, and understand vast amounts of documents, from invoices and receipts to contracts and forms. With DocumentAI, you can extract meaningful data, insights, and knowledge from various document types, turning unstructured data into actionable insights. Its capabilities range from Optical Character Recognition (OCR) and form parsing to specialized processors tailored for specific industries and use cases.

Prerequisites

  1. Dart SDK installed (Installation Guide)
  2. A Google Cloud Project with DocumentAI API enabled
  3. A Service Account with permissions to access DocumentAI

Running the Tool

DartDocumentAISamples provides a command-line interface to interact with Google Cloud's DocumentAI.

  1. Place Service Account Key:

    • Ensure your Service Account key JSON file is placed in the assets/ directory under the name sa-keys.json.
  2. List Available Commands:

    • To view the list of available commands and their descriptions, run:
    dart bin/main.dart --help
  3. Execute a Specific Command:

    • Replace <command_name> with the command you wish to execute, and use the appropriate options and arguments for the command:
    dart bin/main.dart <command_name> --<option_name> <option_value>

    For example, to list available processor types:

    dart bin/main.dart listProcessorTypes
  4. Get Detailed Help for a Command:

    • For more detailed information about a specific command, use:
    dart bin/main.dart help <command_name>

Quick Start with Examples

To help you quickly get started with DartDocumentAISamples, we provide an example.sh script. This script allows you to easily run specific commands with pre-defined parameters. It's a great way to see the tool in action with minimal setup.

Using the example.sh Script

  1. Ensure Prerequisites:

    • Make sure you have the Dart SDK installed and your Google Cloud Project is set up with the DocumentAI API and a Service Account as described in the Prerequisites section.
  2. Run a Command:

    • Use the example.sh script followed by the command name to execute a predefined command. For example, to process a document using the Form Parser processor, run:
      ./example.sh processDocumentWithFormParser
    • Similarly, to process a document using a Specialized processor, execute:
      ./example.sh processDocumentUsingSpecializedProcessor
  3. Explore Other Commands:

    • The script supports several commands matching the TODOs in our roadmap. Simply replace the command name in the script call with the one you wish to test.

TODOs

DEMO

dartdocumentaicli-demo.mov

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. As this project is a work-in-progress, any contribution to help complete the TODOs list would be appreciated.

Acknowledgments

This project draws inspiration from the official samples provided by Google. For a comprehensive list of samples and their descriptions, refer to Google's DocumentAI Samples.

License

This project is licensed under the MIT License, which allows for modification, distribution, and private use. Contributions are welcome, and forking the project for your own use is encouraged. For more details, see the LICENSE file in the repository.

Further Reading

For additional information and resources related to this project and DocumentAI, consider visiting the following links:

About

A hands-on CLI tool sample showcasing the integration of Dart with Google Cloud's DocumentAI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published