If your document isn't covered by one of Mindee's Off-the-Shelf document endpoints,
you can create your own with the
Specification for a custom endpoint configuration:
The "document type" field in the "Settings" page of the API Builder.
The name of the attribute used to retrieve a single document from the API response.
The name of the attribute used to retrieve multiple documents from the API response.
Your organization's username in the API Builder.
Your API key for the endpoint. Optional, since this can be set with an environment variable.
If set, locks the version of the model to use. If not set, use the latest version of the model.
If this is set, it will mean having to update your code every time a new model is trained.
This is probably not what you want for development, but can be very useful for production use.
from mindee import Client mindee_client = Client().config_custom_doc( document_type="pokemon-card", singular_name="card", plural_name="cards", account_name="pikachu", api_key="pokemon-card-api-key", # optional, can be set in environment # version="1.2", # optional, see arguments section above )
You can also set the API keys as environment variables.
The format is
<document_type> are uppercase, any
- replaced with
The example above would look for:
The call to the
parse method is the same as with Off-the-Shelf documents.
loaded_doc = mindee_client.doc_from_path("/my/cards/pikachu.jpg") parsed_data = loaded_doc.parse("pokemon-card")
NOTE: If your custom document has the same name as an Off-The-Shelf document,
you must specify your username when calling the
from mindee import Client mindee_client = Client().config_custom_doc( document_type="receipt", singular_name="receipt", plural_name="receipts", account_name="JohnDoe", api_key="johndoe-receipt-api-key", ) loaded_doc = mindee_client.doc_from_path("/path/to/receipt.jpg") parsed_data = loaded_doc.parse("receipt", "JohnDoe")
Updated about 2 months ago