Skip to main content

Document Insighter Python Client

Project description

Document Insighter Python Client

document-insighter is a set of tools that enables developers to interactive with Document Insighter API, like query extraction results.

Installation

pip install document-insighter

Getting Started

Configure ENV variables

# Client application credentials
INSIGHTER_CLIENT_IDP=xxxx
INSIGHTER_CLIENT_ID=xxxx
INSIGHTER_CLIENT_SECRET=xxxx

# Client access token file path
INSIGHTER_CLIENT_TOKEN_PATH=insighter_token.json

Fetch Token

from document_insighter.api_client import DocumentInsighter
from document_insighter.model import Env

# Change to Env.PRODUCTION for production
document_insighter = DocumentInsighter(Env.STAGING)
document_insighter.fetch_token()

Query Extractions

from datetime import datetime

pages_generator = document_insighter.query_extractions_pages(datetime(2022, 4, 13), datetime(2022, 4, 14), page_size=50)
extractions = [x for page in pages_generator for x in page]

# read first extraction
sections = extractions[0].get('data').get('sections')
batch_sections = list(filter(lambda x:x.get('category') == 'coa_batch', sections))
aggregation_sections = list(filter(lambda x:x.get('category') == 'coa_aggregation', sections))

License

MIT

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

document-insighter-0.0.4.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

document_insighter-0.0.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file document-insighter-0.0.4.tar.gz.

File metadata

  • Download URL: document-insighter-0.0.4.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for document-insighter-0.0.4.tar.gz
Algorithm Hash digest
SHA256 da26dcf8d8f44b4e00e73c70b7c51c98ebd68b955efb6cf65d207df731e3c588
MD5 a85bb4eab05340f2734183d222833e3d
BLAKE2b-256 8b1887408fe20b4c88e986984eecd6959675321acaf3f50cab4d5967ce4bc5fa

See more details on using hashes here.

File details

Details for the file document_insighter-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for document_insighter-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bdabfd1d12b7980c3983d8fc048eb123e0599bb2a8e964e844c8759ae47fd148
MD5 bb89e28ee0e19f1ba1d5d5681c5302ea
BLAKE2b-256 a5d9a1afbfab67b5c4dfa8211bfe3170b8f86db2dc07f2fc831cf69122e2f6ab

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