UnderDoc CLI

1. Introduction

UnderDoc also provide a CLI tools for our users.

2. Requirements

  • MacOS
  • Homebrew

3. Installation

Install UnderDoc CLI
1
2
3

brew tap under-doc/underdoc
brew install underdoc

4. Commands

Configure UnderDoc CLI

Note: Signup at https://dev-portal.underdoc.io for a free api key.

Configure UnderDoc CLI
1
2

underdoc configure

Extract expense data from image file

Extract Expense Data
1
2

underdoc extract-expense-data <image_file_name>

Example:

Extract Expense Data - Example
1
2

underdoc extract-expense-data receipt-8-tea-restaurant-chin.png

Sample image

Sample output:

Sample Expense Data CLI Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

{
    "receipt_data": {
        "image_type": "Receipt",
        "expense": {
            "shop_name": "深仔記",
            "shop_address": "尖沙咀亞厘道29-39號\n九龍中心地下A舖",
            "date": "2021-04-27",
            "expense_category": "Food",
            "currency": "HKD",
            "total_amount": 39.0,
            "items": [
                {
                    "name": "早餐拼\n(早優)\n叉燒/面",
                    "quantity": 1.0,
                    "unit_price": 36.0,
                    "subtotal": 36.0
                },
                {
                    "name": "早B餐跟\n煎旦/油多",
                    "quantity": 1.0,
                    "unit_price": 0.0,
                    "subtotal": 0.0
                },
                {
                    "name": "(跟)冬啡\n少甜",
                    "quantity": 1.0,
                    "unit_price": 3.0,
                    "subtotal": 3.0
                }
            ]
        }
    }
}