Skip to main content

Butler Doc AI

Project description

Butler DocAI

DocAI helps developers quickly build document, image and text processing pipelines using open source and cloud-based machine learning models for a wide range of applications.


🚧 DocAI is still a work-in-progress and undergoing early development.

Our goal is to put modern machine-learning technology in the hands of the 20+ million developers in the world. If this excites you, we are looking for early adopters to come along for the ride!

Requirements

Python >= 3.7

Installation & Usage

To install DocAI with pip:

pip install docai-py

System Dependencies

Mac

Linux

  • Install poppler-utils via your package manager

Getting Started

Please follow the installation procedure and then run the following:

from docai import PredictionClient



# Get API Key from https://docs.butlerlabs.ai/reference/uploading-documents-to-the-rest-api#get-your-api-key

api_key = '<api-key>'

# Get Queue ID from https://docs.butlerlabs.ai/reference/uploading-documents-to-the-rest-api#go-to-the-model-details-page

queue_id = '<queue_id>'

# Path to a local JPEG, PNG, or PDF file

local_file_path = 'example.pdf'



extraction_results = PredictionClient(api_key).extract_document(queue_id, local_file_path)

print(extraction_results)

Maintain

Install Packages for Development

Install poetry on your host machine

poetry install

Butler REST API Codegen

To regenerate code updates to REST API:

openapi-python-client update --url https://app.butlerlabs.ai/api/docs-json --config codegen.yaml

Running Unit Tests

To run all unit tests:

poetry run pytest -v -m unit_tests

Alternatively, you can also use VSCode's "Testing" tab to run/debug individual tests

Adding a New Dependency

To add a new pip package dependency, see poetry add.

For versioning, it is best to use the minimum version that works, combined with ^, ~, or >= and < checks.

For example:

  • poetry add my-package@^1.2.3 is a shorthand for >=1.2.3,<2.0.0

  • poetry add my-package@~1.2.3 is a shorthand for >=1.2.3,<1.3.0

  • poetry add "my-package>=1.2.3,<4.5.6"

For development only dependencies, make sure to include the --dev flag.

Build and Publish

Build and Publish Setup

# setup for testpypi

poetry config repositories.testpypi https://test.pypi.org/legacy/

poetry config pypi-token.testpypi <testpypi token>



# setup for pypi

poetry config repositories.pypi https://upload.pypi.org/legacy/

poetry config pypi-token.pypi <pypi token>

Build and Publish Procedure

Update pyproject.toml and docai/__init__.py to have a new version number

# build packages

poetry build



# upload to test pypi

poetry publish -r testpypi



# test install from test pypi

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple docai-py



# upload to real pypi

poetry publish -r pypi

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

docai_py-0.1.1.tar.gz (133.0 kB view details)

Uploaded Source

Built Distribution

docai_py-0.1.1-py3-none-any.whl (344.3 kB view details)

Uploaded Python 3

File details

Details for the file docai_py-0.1.1.tar.gz.

File metadata

  • Download URL: docai_py-0.1.1.tar.gz
  • Upload date:
  • Size: 133.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.13 Darwin/19.6.0

File hashes

Hashes for docai_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 90b81590ebfd342ac860e3f384b0ab0aa9310c77d742b6150adb4bf4ec939e1b
MD5 69050a2bd51a7bcb2cb58f226062da15
BLAKE2b-256 bf61b5c0a1e0441bc0cbc08420c727f258653fd280ce92308cf62e8ffe5035f6

See more details on using hashes here.

File details

Details for the file docai_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: docai_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 344.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.13 Darwin/19.6.0

File hashes

Hashes for docai_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7dbe4b04ccf7f015d532f8353dac44888539a0e3f02732241e185aaf0a6536
MD5 5b07b5bad11ebda9695b0d6d7d30c73c
BLAKE2b-256 a6042e071c457acbfb605e0f64633b7343edf32040eb1f4001877b303c27a80a

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