mindee_client

package module
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Mindee Client

A simple Golang client for the Mindee API, allowing you to extract invoice data from JPEG, PNG, WEBP, HEIC, TIFF image or PDF files.

Installation

To use this library in your Go project, run the following command:

go get github.com/altafino/mindee-client

Usage

Import the mindee-client library in your Go code:

import "github.com/altafino/mindee-client"

This library provides two methods for getting invoice data from files:

  1. GetInvoiceDataForFilePath(filePath, apiKey string) (*models.InvoiceData, error) - for getting invoice data from a file path
  2. GetInvoiceDataForBase64(base64Content, apiKey string) (*models.InvoiceData, error) - for getting invoice data from a base64-encoded file
Example
package main

import (
    "fmt"
    "os"
    "github.com/altafino/mindee-client"
    "github.com/joho/godotenv"
)

func main() {
    // Load .env file (API_KEY and TEST_FILE_PATH)
    if err := godotenv.Load(); err != nil {
        fmt.Printf("Error loading .env file: %v\n", err)
        return
    }
}

Testing

To run tests for this library, execute the following command in the root directory of the project:

go test

License

This library is released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInvoiceDataForBase64

func GetInvoiceDataForBase64(base64Content, apiKey string) (*models.InvoiceData, error)

func GetInvoiceDataForFilePath

func GetInvoiceDataForFilePath(filePath, apiKey string) (*models.InvoiceData, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址