All Projects → veryfi → veryfi-go

veryfi / veryfi-go

Licence: MIT license
Go module for communicating with the Veryfi OCR API

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to veryfi-go

Receipt Parser Legacy
A supermarket receipt parser written in Python using tesseract OCR
Stars: ✭ 614 (+3311.11%)
Mutual labels:  ocr, invoice
Manta
🎉 Flexible invoicing desktop app with beautiful & customizable templates.
Stars: ✭ 5,160 (+28566.67%)
Mutual labels:  receipt, invoice
receipt-manager-app
Receipt parser application written in dart.
Stars: ✭ 140 (+677.78%)
Mutual labels:  ocr, receipt
Url To Pdf Api
Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
Stars: ✭ 6,544 (+36255.56%)
Mutual labels:  receipt, invoice
receipt-parser-server
Receipt parser server written in python.
Stars: ✭ 64 (+255.56%)
Mutual labels:  ocr, receipt
NLP-image-to-text
code to extract text from images
Stars: ✭ 28 (+55.56%)
Mutual labels:  ocr
blog
技术资料日常积累(欢迎投稿)
Stars: ✭ 59 (+227.78%)
Mutual labels:  ocr
ratelimiter
A concurrent rate limiter library for Golang based on Sliding-Window rate limiter algorithm.
Stars: ✭ 218 (+1111.11%)
Mutual labels:  go-library
shape-context-ocr
The Shape Context is a shape descriptor that captures the relative positions of other points on the shape contours, and is used to recognize characters.
Stars: ✭ 20 (+11.11%)
Mutual labels:  ocr
DocTr
The official code for “DocTr: Document Image Transformer for Geometric Unwarping and Illumination Correction”, ACM MM, Oral Paper, 2021.
Stars: ✭ 202 (+1022.22%)
Mutual labels:  ocr
ESCPOS
A ESC/POS Printer Commands Helper
Stars: ✭ 26 (+44.44%)
Mutual labels:  receipt
How-to-use-tesseract-ocr-4.0-with-csharp
How to use Tesseract OCR 4.0 with C#
Stars: ✭ 60 (+233.33%)
Mutual labels:  ocr
tibetan-ocr
Python OCR for Handwritten Tibetan Mauscripts
Stars: ✭ 19 (+5.56%)
Mutual labels:  ocr
escpos-tools
Utilities to read ESC/POS print data
Stars: ✭ 145 (+705.56%)
Mutual labels:  receipt
i-librarian-free
I, Librarian - open-source version of a PDF managing SaaS.
Stars: ✭ 110 (+511.11%)
Mutual labels:  ocr
dinglehopper
An OCR evaluation tool
Stars: ✭ 38 (+111.11%)
Mutual labels:  ocr
Inventory Kamera
Scans Genshin Impact characters, artifacts, and weapons from the game window into a JSON file.
Stars: ✭ 348 (+1833.33%)
Mutual labels:  ocr
digdet
A realtime digit OCR on the browser using Machine Learning
Stars: ✭ 22 (+22.22%)
Mutual labels:  ocr
Printed-Chinese-Character-OCR
This is a Chinese Character ocr system based on Deep learning (VGG like CNN neural net work),this rep include trainning set generating,image preprocesing,NN model optimizing based on Keras high level NN framwork
Stars: ✭ 21 (+16.67%)
Mutual labels:  ocr
responsive-html-email-templates
Collection of Free responsive HTML templates for Startups
Stars: ✭ 187 (+938.89%)
Mutual labels:  invoice

Go Reference Go Report Card Test

Veryfi Logo

veryfi-go is a Go module for communicating with the Veryfi OCR API.

Table of Contents

Installing

This package can be installed by cloning this directory:

git clone https://github.com/veryfi/veryfi-go.git

or using go get:

go get github.com/veryfi/veryfi-go

Getting Started

Obtaining Client ID and user keys

If you don't have an account with Veryfi, please go ahead and register here: https://hub.veryfi.com/signup/api/

Setting up the project

For the ease of developing, a Makefile is included for several handy commands. Simply issue make help for more informations.

clean                Remove temporary files and build artifacts
cover                Run unit tests and open the coverage report
fmt                  Run gofmt on all files
github-tag           Create and push a tag with the current client version
help                 Print usage information
lint                 Lint project source files
test-integration     Run integration tests
test-unit            Run unit tests
version              Print the version

Go API Client Library

The Veryfi library can be used to communicate with Veryfi API. All available functionality is described here https://pkg.go.dev/github.com/veryfi/veryfi-go/veryfi.

Below is the sample script using Veryfi to OCR and extract data from a document:

package main

import (
	"fmt"
	"log"
	"time"

	"github.com/veryfi/veryfi-go/veryfi"
	"github.com/veryfi/veryfi-go/veryfi/scheme"
)

func main() {
	timeout, err := time.ParseDuration("10s")
	if err != nil {
		log.Fatal(err)
	}

	client, err := veryfi.NewClientV7(&veryfi.Options{
		ClientID: "YOUR_CLIENT_ID",
		Username: "YOUR_USERNAME",
		APIKey:   "YOUR_API_KEY",
		HTTP: veryfi.HTTPOptions{
			Timeout: timeout,
			Retry: veryfi.RetryOptions{
				Count: 1,
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.ProcessDocumentURL(scheme.DocumentURLOptions{
		FileURL: "YOUR_HOSTED_FILE_URL",
		DocumentSharedOptions: scheme.DocumentSharedOptions{
			Tags: []string{"electric", "repair", "ny"},
		},
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%+v", resp)
}

A successful response will look something like this:

&{ABNNumber: AccountNumber: BillToAddress: BillToName: BillToVATNumber: CardNumber: Category: Created:2021-05-20 19:21:38 CurrencyCode:USD Date:2019-02-26 00:00:00 DeliveryDate: Discount:0 DocumentReferenceNumber: DueDate:2019-02-26 ExternalID: ID:23002226 ImgFileName:3947f571-a41b-4b79-abc7-c0d9805c8610.png ImgThumbnailURL:https://scdn.veryfi.com/receipts/3947f571-a41b-4b79-abc7-c0d9805c8610_1_t.png?Expires=1621538559&Signature=BokBYv9jyJcXbCXu49DqxHwRdAWEgG8xfMw7LHujXSCA5y4kGd-QaBDwMzMCgCuM0Ezdrv3lgAZa0Cr8A5DKAzymXxnfdEiV46w~iy1zGPRgx6IkqvllB4bWqHFdwuu88CJarfIjvkcaygcECiFHg3RSKuuN4eGUYDP~fK8ER~Awb9Cr5FpTbTMc9kOfyc~vii2Mikg3TBiTbcdshhjgD2oRI4nFh1fpwRpfHAArIR-ijYAetjFEOQycUiu6WnzWAyEV9RCP9KcrKOnY5eKD-mm5mKuGQGXX1OT2AGw80klF1epx7XppeER9kALF1s8Dq87s8gdnnVsrstEF3~e8Yg__&Key-Pair-Id=APKAJCILBXEJFZF4DCHQ ImgURL:https://scdn.veryfi.com/receipts/3947f571-a41b-4b79-abc7-c0d9805c8610.png?Expires=1621538559&Signature=G7T6n7~Gpr1Pi5rfPRn1GoOeTlKZnVxLbWSZf~svnNpytILXvN9tg7y-Ib39lcifHeM6vjVfm4Pa4k63-ri~SySGFq-RWtF4IjQGM3Hw4~8wHB-sPhorn4JeVd~e~CpaUgFJbGSRnbb1cmBDFdkuBMbLkdC7m5ifwE10kanUU87Q~vpDYLkQINzfylHJk21rwtSPvIiEX8rudLK1F1BGl7TWvx-o7BT~PTCJ-RsA~j4eGuOprDXpt5Achpf-LMUa-iRCpMFupWVOZFPGln8rDqp-TcpryTawTbNlajg0nFDtF1eqBlbfoEycb-ZECtV4KECZtle5T7rBqhGQsmUxNQ__&Key-Pair-Id=APKAJCILBXEJFZF4DCHQ Insurance: InvoiceNumber:   US-001 IsDuplicate:0 LineItems:[] OCRText:

INVOICE                         LOGO
East Repair Inc.
1912 Harvest Lane
New York, NY 12210
BILL TO SHIP TO INVOICE #       US-001
John Smith      John Smith      INVOICE DATE    11/02/2019
2 Court Square  3787 Pineview Drive
New York, NY 12210      Cambridge, MA 12210     P.O.    2312/2019
        DUE DATE        26/02/2019

QTY     DESCRIPTION     UNIT PRICE      AMOUNT

1       Front and rear brake cables             100.00  100.00
2 New set of pedal arms         15.00   30.00
3       Labor 3hrs                      5.00    15.00

        Subtotal        145.00
        Sales Tax 6.25% 9.06
        TOTAL   $154.06

        TERMS & CONDITIONS
Thank you       , Please make checks payable to: East Repair Inc.
        Payment is due within 15 days
        John Smith
 OrderDate: PaymentDisplayName:No Payment, PaymentTerms: PaymentType:no_payment, PhoneNumber: PurchaseOrderNumber: Rounding:0 ServiceEndDate: ServiceStartDate: ShipDate: ShipToAddress: ShipToName: Shipping:0 StoreNumber: Subtotal:145 Tax:9.06 TaxLines:[] Tip:0 Total:154.06 TotalWeight: TrackingNumber: Updated:2021-05-20 19:21:39 VATNumber: Vendor:{Address:1912 harvest lane new york, ny 12210 2 court square    3787 pineview drive Category: Email: FaxNumber: Name: PhoneNumber: RawName: VendorLogo: VendorRegNumber: VendorType: Web:} VendorAccountNumber: VendorBankName: VendorBankNumber: VendorBankSwift: VendorIban:}%

For more examples about different methods to process documents, refer to the documentation's examples.

Testing

To run unit tests:

make test-unit

To run integration tests, supply your CLIENT_ID, CLIENT_SECRET, USERNAME, and API_KEY environment variables in Makefile and run make test-integration:

.PHONY: test-integration
test-integration:  ## Run integration tests
	CLIENT_ID=FIXME CLIENT_SECRET=FIXME USERNAME=FIXME API_KEY=FIXME go test -race -cover -run Integration -coverprofile=coverage.out -covermode=atomic ./...

Need Help?

If you run into any issue or need help installing or using the library, please contact [email protected].

If you found a bug in this library or would like new features added, then open an issue or pull requests against this repo!

To learn more about Veryfi visit https://www.veryfi.com/.

Tutorial

Below is a introduction to the Go SDK. We're gonna walkthrough a problem and solve it together:

Let’s say we are faced with a challenge where we have to capture and extract data from thousands (or even millions) of backlogged receipts. We don’t want to do it manually because copying and pasting from files to files takes a lot of time and is often error-prone. Also, different receipts have different forms and styles, finding the meaningful data across a huge pile of files can be a tedious task. What is even better is if we could extract the receipts and see the processing in real-time where the results can be returned almost immediately in seconds, not hours. So now, what is the best way that we can solve this?

Link to blog post →

If you prefer a video format, here is the link to our Youtube channel →

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].