Skip to content

Commit

Permalink
📝 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianardee committed Nov 7, 2022
1 parent 45690f6 commit b1f43ed
Show file tree
Hide file tree
Showing 34 changed files with 384 additions and 238 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mindee Python API Library Changelog

## v3.0.0 (2022-10-31)
## v3.0.0 (2022-11-07)
### ¡Breaking Changes!
* :sparkles: New PDF cut/merge system, allowing specifying exactly which pages to use.
* :recycle: PDF documents are no longer cut by default, use the `page_options` parameter in the `parse` method.
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.doc_from_path("/path/to/the/invoice.pdf")
# Parse the document as an invoice by passing the documents.Invoice type
# Parse the document as an invoice by passing the appropriate type
api_response = input_doc.parse(documents.TypeInvoiceV3)

# Print a brief summary of the parsed data
Expand All @@ -39,7 +39,7 @@ mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.doc_from_path("/path/to/the/check.jpg")
# Parse the document as a USA bank check by passing the documents.us.TypeBankCheckV1 type
# Parse the document as a USA bank check by passing the appropriate type
api_response = input_doc.parse(documents.us.TypeBankCheckV1)

# Print a brief summary of the parsed data
Expand Down Expand Up @@ -72,7 +72,10 @@ There's more to it than that for those that need more features, or want to
customize the experience.

All the juicy details are described in the
**[Official Documentation](https://developers.mindee.com/docs/python-sdk)**.
**[Official Guide](https://developers.mindee.com/docs/python-sdk)**.

You can also take a look at the
**[Reference Documentation](https://mindee.github.io/mindee-api-python/)**.

## License
Copyright © Mindee
Expand Down
9 changes: 6 additions & 3 deletions docs/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Client

DocumentClient
--------------
.. autoclass:: mindee.input.page_options.PageOptions
:members:

.. autoclass:: mindee.client.DocumentClient
:members:

DocumentResponse
----------------
.. autoclass:: mindee.response.DocumentResponse
PredictResponse
---------------
.. autoclass:: mindee.response.PredictResponse
:members:
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -56,4 +57,13 @@
html_static_path = ["_static"]


# -- autodoc -----------------------------------------------------------------

autodoc_member_order = "groupwise"
autodoc_class_signature = "separated"
autodoc_typehints = "description"
autodoc_default_options = {"undoc-members": True, "exclude-members": "__init__"}

# -- autodoc-typehints -------------------------------------------------------

typehints_defaults = "comma"
48 changes: 0 additions & 48 deletions docs/documents.rst

This file was deleted.

60 changes: 0 additions & 60 deletions docs/field_types.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/geometry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
----------------
Geometry Helpers
----------------

.. automodule:: mindee.geometry
:members:
:undoc-members:
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ https://developers.mindee.com/docs/python-sdk
:caption: Contents:

client
field_types
documents
products/index
geometry
4 changes: 4 additions & 0 deletions docs/products/custom.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Custom Documents
================
.. autoclass:: mindee.documents.CustomV1
:members:
87 changes: 87 additions & 0 deletions docs/products/field_types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
------
Fields
------

Off the Shelf Documents
=======================

Base Field
----------
.. autoclass:: mindee.fields.base.BaseField
:members:
:inherited-members:

Text Field
----------
.. autoclass:: mindee.fields.text.TextField
:members:
:inherited-members:

Typed Field
-----------
.. autoclass:: mindee.fields.typed.TypedField
:members:
:inherited-members:

Amount Field
------------
.. autoclass:: mindee.fields.amount.AmountField
:members:
:inherited-members:

Date Field
----------
.. autoclass:: mindee.fields.date.DateField
:members:
:inherited-members:

Tax Field
---------
.. autoclass:: mindee.fields.tax.TaxField
:members:
:inherited-members:

Locale Field
------------
.. autoclass:: mindee.fields.locale.LocaleField
:members:
:inherited-members:

Orientation
-----------
.. autoclass:: mindee.fields.orientation.Orientation
:members:
:inherited-members:

Payment Details
---------------
.. autoclass:: mindee.fields.payment_details.PaymentDetails
:members:
:inherited-members:

Position
--------
.. autoclass:: mindee.fields.position.Position
:members:
:inherited-members:

Custom Documents
================

Value List
----------
.. autoclass:: mindee.fields.api_builder.ListField
:members:
:inherited-members:

Word Value
----------
.. autoclass:: mindee.fields.api_builder.ListFieldValue
:members:
:inherited-members:

Classification
--------------
.. autoclass:: mindee.fields.api_builder.ClassificationField
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/products/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---------
Documents
---------

.. toctree::
:maxdepth: 2

./international
./us
./custom
./field_types
27 changes: 27 additions & 0 deletions docs/products/international.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
International
=============

Invoices
--------
.. autoclass:: mindee.documents.InvoiceV3
:members:

Expense Receipts
----------------
.. autoclass:: mindee.documents.ReceiptV3
:members:

.. autoclass:: mindee.documents.ReceiptV4
:members:

Passports
---------
.. autoclass:: mindee.documents.PassportV1
:members:

Financial Documents
-------------------
.. autoclass:: mindee.documents.FinancialV1
:members:
:undoc-members:
:exclude-members: __init__, request
8 changes: 8 additions & 0 deletions docs/products/us.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
United States of America
========================

Bank Checks
-----------
.. autoclass:: mindee.documents.us.BankCheckV1
:members:
:undoc-members:
28 changes: 16 additions & 12 deletions mindee/client.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import json
from typing import BinaryIO, Dict, Optional, Type

from mindee.documents import (
CustomV1,
FinancialV1,
InvoiceV3,
PassportV1,
ReceiptV3,
ReceiptV4,
)
from mindee.documents.base import Document, TypeDocument
from mindee.documents.config import DocumentConfig, DocumentConfigDict
from mindee.documents.custom.custom_v1 import CustomV1
from mindee.documents.financial.financial_v1 import FinancialV1
from mindee.documents.invoice.invoice_v3 import InvoiceV3
from mindee.documents.passport.passport_v1 import PassportV1
from mindee.documents.receipt.receipt_v3 import ReceiptV3
from mindee.documents.receipt.receipt_v4 import ReceiptV4
from mindee.documents.us.bank_check.bank_check_v1 import BankCheckV1
from mindee.documents.us import BankCheckV1
from mindee.endpoints import OTS_OWNER, CustomEndpoint, HTTPException, StandardEndpoint
from mindee.input.page_options import PageOptions
from mindee.input.sources import (
Expand Down Expand Up @@ -55,13 +57,15 @@ def parse(
"""
Call prediction API on the document and parse the results.
:type document_class: DocT
:param endpoint_name: Document type to parse
:param document_class: The document class to use.
The response object will be instanced based on this parameter.
:param endpoint_name: For custom documents, the "API name" field
in the "Settings" page of the API Builder.
:param account_name: API username, the endpoint owner
:param include_words: Include all the words of the document in the response
:param close_file: Whether to `close()` the file after parsing it.
Set to `False` if you need to access the file after this operation.
:param page_options: PageOptions object for cutting multipage documents.
:param close_file: Whether to ``close()`` the file after parsing it.
Set to ``False`` if you need to access the file after this operation.
:param page_options: Options for preparing multipage documents.
"""
if get_bound_classname(document_class) != CustomV1.__name__:
endpoint_name = get_bound_classname(document_class)
Expand Down
Loading

0 comments on commit b1f43ed

Please sign in to comment.