Skip to main content

Python SDK for Lucidtech AI Services

Project description

# Python SDK for Lucidtech AI Services API

## Installation

```bash
$ pip install lucidtech-las
```

## Usage Match Receipts

```python
from las import Client, Receipt

api_key = '...'
client = Client(api_key)

transactions = {
'transaction_1': {'total': '100.00', 'date': '2017-08-21'},
'transaction_2': {'total': '340.90', 'date': '2016-03-08'},
'transaction_3': {'total': '90.37', 'date': '2017-02-17'}
}

receipts = {
'receipt_1': Receipt(url='https://example.com/receipt1.jpeg'),
'receipt_2': Receipt(url='https://example.com/receipt2.jpeg'),
'receipt_3': Receipt(url='https://example.com/receipt3.jpeg'),
}

matching_fields = [
'total',
'date'
]

response = client.match_receipts(
transactions=transactions,
receipts=receipts,
matching_fields=matching_fields
)

print(response['matchedTransactions'])

# {'transaction_1': 'receipt_2', 'transaction_3': 'receipt_1'}

print(response['notMatchedTransactions'])

# ['transaction_2']
```

## Usage Scan Receipt

```python
from las import Client, Receipt

api_key = '...'
client = Client(api_key)

receipt = Receipt(url='https://example.com/img.jpeg')
fields = client.scan_receipt(receipt)
print(fields)

# [{'label': 'total', 'value': '157.00', 'confidence': '0.968395300'} ...]

with open('img.jpeg', 'rb') as fp:
receipt = Receipt(fp=fp)
fields = client.scan_receipt(receipt)
print(fields)

# [{'label': 'total', 'value': '157.00', 'confidence': '0.968395300'} ...]

receipt = Receipt(filename='img.jpeg')
fields = client.scan_receipt(receipt)
print(fields)

# [{'label': 'total', 'value': '157.00', 'confidence': '0.968395300'} ...]
```

Project details


Release history Release notifications | RSS feed

This version

0.0.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lucidtech-las-0.0.5.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file lucidtech-las-0.0.5.tar.gz.

File metadata

File hashes

Hashes for lucidtech-las-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a193cb22bf58f80671795dcb7103fdfe1b1bb914420d731e9e9e875f8f666687
MD5 1e7502a1ea3e041c03eb1bab4445287b
BLAKE2b-256 19f94e927fb9c86e89614f9b6c4efff76f874f46bcb34db309d1d3b0ce21077b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page