unstructured

package
v0.0.0-...-462a0f0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedExtensions = []string{
	".bmp",
	".csv",
	".doc",
	".docx",
	".eml",
	".epub",
	".heic",
	".html",
	".jpeg",
	".png",
	".md",
	".msg",
	".odt",
	".org",
	".p7s",
	".pdf",
	".png",
	".ppt",
	".pptx",
	".rst",
	".rtf",
	".tiff",
	".txt",
	".tsv",
	".xls",
	".xlsx",
	".xml",
}

https://docs.unstructured.io/api-reference/api-services/supported-file-types

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(url string, options ...Option) (*Client, error)

func (*Client) Extract

func (c *Client) Extract(ctx context.Context, input extractor.File, options *extractor.ExtractOptions) (*extractor.Document, error)

type Element

type Element struct {
	ID string `json:"element_id"`

	Type string `json:"type"`
	Text string `json:"text"`

	Metadata ElementMetadata `json:"metadata"`
}

type ElementMetadata

type ElementMetadata struct {
	FileName string `json:"filename"`
	FileType string `json:"filetype"`

	Languages []string `json:"languages"`
}

type Option

type Option func(*Client)

func WithClient

func WithClient(client *http.Client) Option

func WithStrategy

func WithStrategy(strategy Strategy) Option

func WithToken

func WithToken(token string) Option

type Strategy

type Strategy string
const (
	StrategyAuto  Strategy = "auto"
	StrategyFast  Strategy = "fast"
	StrategyHiRes Strategy = "hi_res"
)

Jump to

Keyboard shortcuts

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