Skip to content

Commit 844c63b

Browse files
authored
🔖 Version 4.24.0 (#340)
1 parent 2a1a4e8 commit 844c63b

File tree

3 files changed

+29
-189
lines changed

3 files changed

+29
-189
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# Mindee Python API Library Changelog
1+
# Mindee Python Client Library Changelog
2+
3+
## v4.24.0
4+
### Changes
5+
* :sparkles: Add support for mindee API V2 client & features
6+
* :wrench: Tweak CI & testing
7+
* :recycle: Uniformize variable naming across files
8+
* :boom: remove support for Python 3.7
9+
210

311
## v4.24.0-rc2 - 2025-07-09
412
### Changes

README.md

Lines changed: 19 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -3,207 +3,39 @@
33
# Mindee API Helper Library for Python
44
Quickly and easily connect to Mindee's API services using Python.
55

6-
## Quick Start
7-
Here's the TL;DR of getting started.
6+
## Mindee API Versions
7+
This client library has support for both Mindee platform versions.
88

9-
First, get an [API Key](https://developers.mindee.com/docs/create-api-key)
9+
### Latest - V2
10+
This is the new platform located here:
1011

11-
Then, install this library:
12-
```shell
13-
pip install mindee
14-
```
12+
https://app.mindee.com
1513

16-
Finally, Python away!
14+
It uses **API version 2**.
1715

18-
### Loading a File and Parsing It
16+
Consult the
17+
**[Latest Documentation](https://docs.mindee.com/integrations/client-libraries-sdk)**
1918

20-
#### Global Documents
21-
```python
22-
from mindee import Client, product
2319

24-
# Init a new client
25-
mindee_client = Client(api_key="my-api-key")
20+
### Legacy - V1
21+
This is the legacy platform located here:
2622

27-
# Load a file from disk
28-
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
23+
https://platform.mindee.com/
2924

30-
# Parse the document as an invoice by passing the appropriate type
31-
result = mindee_client.parse(product.InvoiceV4, input_doc)
25+
It uses **API version 1**.
3226

33-
# Print a brief summary of the parsed data
34-
print(result.document)
35-
```
27+
Consult the
28+
**[Legacy Documentation](https://developers.mindee.com/docs/python-getting-started)**
3629

37-
**Note:** Files can also be loaded from:
30+
## Additional Information
3831

39-
A python `BinaryIO` compatible file:
40-
```python
41-
input_doc = mindee_client.source_from_file(my_file)
42-
```
32+
**[Source Code](https://github.com/mindee/mindee-api-python)**
4333

44-
A URL (`HTTPS` only):
45-
```python
46-
input_doc = mindee_client.source_from_url(
47-
"https://files.readme.io/a74eaa5-c8e283b-sample_invoice.jpeg"
48-
)
49-
```
34+
**[Reference Documentation](https://mindee.github.io/mindee-api-python/)**
5035

51-
A base64-encoded string, making sure to specify the extension of the file name:
52-
```python
53-
input_doc = mindee_client.source_from_b64string(
54-
my_input_string, "my-file-name.ext"
55-
)
56-
```
36+
**[Feedback](https://feedback.mindee.com/)**
5737

58-
Raw bytes, making sure to specify the extension of the file name:
59-
```python
60-
input_doc = mindee_client.source_from_bytes(
61-
my_raw_bytes_sequence, "my-file-name.ext"
62-
)
63-
```
64-
65-
#### Region-Specific Documents
66-
```python
67-
from mindee import Client, product
68-
69-
# Init a new client
70-
mindee_client = Client(api_key="my-api-key")
71-
72-
# Load a file from disk
73-
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
74-
75-
# Parse the document as a USA bank check by passing the appropriate type
76-
result = mindee_client.parse(product.us.BankCheckV1, input_doc)
77-
78-
# Print a brief summary of the parsed data
79-
print(result.document)
80-
```
81-
82-
#### Custom Documents (docTI & Custom APIs)
83-
84-
```python
85-
from mindee import Client, product
86-
87-
# Init a new client
88-
mindee_client = Client(api_key="my-api-key")
89-
90-
# Add your custom endpoint (document)
91-
my_endpoint = mindee_client.create_endpoint(
92-
account_name="my-account",
93-
endpoint_name="my-endpoint",
94-
)
95-
96-
# Load a file from disk
97-
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
98-
99-
# Parse the file.
100-
# The endpoint must be specified since it cannot be determined from the class.
101-
result = mindee_client.enqueue_and_parse(
102-
product.GeneratedV1,
103-
input_doc,
104-
endpoint=my_endpoint
105-
)
106-
107-
# Print a brief summary of the parsed data
108-
print(result.document)
109-
110-
# Iterate over all the fields in the document
111-
for field_name, field_values in result.document.fields.items():
112-
print(field_name, "=", field_values)
113-
```
114-
115-
### Enqueue and Parse a Webhook Response
116-
This is an optional way of handling asynchronous APIs.
117-
118-
```python
119-
from mindee import Client, product
120-
121-
mindee_client = Client()
122-
input_source = mindee_client.source_from_path("/path/to/the/file.ext")
123-
124-
result = mindee_client.enqueue_and_parse(
125-
product.FinancialDocumentV1,
126-
input_source,
127-
workflow_id="my-workflow-id",
128-
rag=True,
129-
)
130-
131-
print(result.document)
132-
```
133-
134-
### Additional Options
135-
Options to pass when sending a file.
136-
```python
137-
from mindee import Client, product
138-
from mindee.client import LocalResponse
139-
140-
mindee_client = Client()
141-
input_source = mindee_client.source_from_path("/path/to/the/file.ext")
142-
143-
enqueue_response = mindee_client.enqueue(
144-
product.InternationalIdV2,
145-
input_source,
146-
)
147-
148-
# You can keep track of the job's ID for traceability concerns.
149-
job_id = enqueue_response.job.id
150-
151-
152-
# Load the JSON string sent by the Mindee webhook POST callback.
153-
# Reading the callback data will vary greatly depending on your HTTP server.
154-
# This is therefore beyond the scope of this example.
155-
156-
local_response = LocalResponse(request.body())
157-
158-
# You can also load the json from a local path.
159-
# local_response = LocalResponse("path/to/my/file.ext")
160-
161-
# Optional: verify the HMAC signature
162-
# You'll need to get the "X-Mindee-Hmac-Signature" custom HTTP header.
163-
hmac_signature = request.headers.get("X-Mindee-Hmac-Signature")
164-
if not local_response.is_valid_hmac_signature(my_secret_key, hmac_signature):
165-
raise Error("Bad HMAC signature! Is someone trying to do evil?")
166-
167-
# Deserialize the response
168-
169-
result = mindee_client.load_prediction(
170-
product.InternationalIdV2,
171-
local_response
172-
)
173-
174-
# Print a full summary of the parsed data in RST format
175-
print(result.document)
176-
```
177-
178-
179-
#### Page Options
180-
Allows sending only certain pages in a PDF.
181-
182-
In this example we only send the first, penultimate and last pages:
183-
184-
```python
185-
from mindee import product, PageOptions
186-
187-
result = mindee_client.parse(
188-
product.InvoiceV4,
189-
input_source,
190-
page_options=PageOptions(
191-
page_indexes=[0, -2, -1],
192-
operation=PageOptions.KEEP_ONLY,
193-
on_min_pages=2
194-
)
195-
)
196-
```
197-
198-
You can view the source code on [GitHub](https://github.com/mindee/mindee-api-python).
199-
200-
You can also take a look at the
201-
**[Reference Documentation](https://mindee.github.io/mindee-api-python/)**.
202-
203-
## License
38+
### License
20439
Copyright © Mindee
20540

20641
Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
207-
208-
## Questions?
209-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)

mindee/versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22

3-
__version__ = "4.24.0-rc2"
3+
__version__ = "4.24.0"
44

55
PYTHON_VERSION = f"{sys.version_info[0]}.{sys.version_info[1]}"
66

0 commit comments

Comments
 (0)