Skip to main content

A Python library for the SmartLens API.

Project description

SmartLens Python Library

The SmartLens Python library provides convenient access to the SmartLens API from applications written in the Python language. Integrate state-of-the-art AI into your application in just five lines of code.

Documentation

See the API docs.

Installation

To install the package, simply run:

pip install smartlens

Requirements

  • Python 3.6+

Usage

The library needs to be configured with your account's API key which is available in the SmartLens Dashboard. Set smartlens.api_key to its value:

import smartlens
smartlens.api_key = "YOUR-API-KEY"

# tag image
tags = smartlens.tagImage(
    image = "path/to/my/image"
)

# caption image
captions = smartlens.captionImage(
    image = "path/to/my/image"
)

# process document
extractedItems = smartlens.runDocumentAI(
    document = "path/to/my/document",
    customExtractions = [{'natural_language_query': 'What is the salary?', 'answer_key': 'employee_salary'}] # Custom extractions are optional
)

# process text document
extractedItems = smartlens.runTextAnalysis(
    text = "path/to/my/text",
    customExtractions = [{'natural_language_query': 'What is the salary?', 'answer_key': 'employee_salary'}] # Custom extractions are optional
)

Project details


Download files

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

Source Distribution

smartlens-0.9.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

smartlens-0.9.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file smartlens-0.9.2.tar.gz.

File metadata

  • Download URL: smartlens-0.9.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for smartlens-0.9.2.tar.gz
Algorithm Hash digest
SHA256 0d464ab1a5beb936149b450c7f5ef00f0ec4e73b2ce3f92a95a72023d36f961e
MD5 9fc5e33f18da52ee56a7ab7b91bb977d
BLAKE2b-256 b33330fdc795d2afaa4d490af4f5b4e3f50bcd41ebf67733fb965231e3372191

See more details on using hashes here.

File details

Details for the file smartlens-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: smartlens-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for smartlens-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1ca1f8efcc1d6d16648871149db77df8a7464c27d6e90d9496012bfac4158341
MD5 456d746417158348a01905d4cf6267cd
BLAKE2b-256 20052c052435fa1216c64ffc3b4c3648735c304921c8f7b39cf6d12170b1bd61

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