structocr 1.1.5__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structocr
3
- Version: 1.1.5
4
- Summary: The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, VIN and Container OCR.
3
+ Version: 1.2.0
4
+ Summary: The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, Receipts, VIN, HIN and Container OCR.
5
5
  Home-page: https://structocr.com
6
6
  Author: StructOCR Team
7
7
  Author-email: support@structocr.com
@@ -27,7 +27,6 @@ Dynamic: requires-dist
27
27
  Dynamic: requires-python
28
28
  Dynamic: summary
29
29
 
30
-
31
30
  # StructOCR Python SDK
32
31
 
33
32
  [![PyPI version](https://badge.fury.io/py/structocr.svg)](https://badge.fury.io/py/structocr)
@@ -35,19 +34,35 @@ Dynamic: summary
35
34
 
36
35
  **The official Python client for [StructOCR](https://structocr.com).**
37
36
 
38
- StructOCR is a powerful API tailored for developers to extract structured data from identity documents with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **VIN OCR**, and **Container OCR** into your Python applications in minutes.
37
+ StructOCR is a powerful API tailored for developers to extract structured data from complex documents and physical assets with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **Receipt OCR**, **VIN OCR**, **HIN OCR**, and **Container OCR** into your Python applications in minutes.
39
38
 
40
39
  👉 **[Get your Free API Key here](https://structocr.com)**
41
40
 
41
+ -----
42
+
43
+ ## 🚀 What's New in 1.2.0
44
+
45
+ We've massively expanded our expense automation and marine capabilities\! The SDK now natively supports:
46
+
47
+ * **Receipt OCR**: Parse retail and dining receipts to extract merchants, individual line items, taxes, and totals.
48
+ * **HIN OCR**: Extract, parse, and validate Hull Identification Numbers from boats and watercraft.
49
+ * *Previous 1.1.6 additions (Container OCR, VIN OCR, Invoice OCR) remain fully supported.*
50
+
51
+ Check out the [Quick Start](#quick-start) below to see how easy it is to use them!
52
+
53
+ -----
54
+
42
55
  ## Features
43
56
 
44
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
45
- - **National ID OCR**: Support for ID cards with automatic field mapping.
46
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
47
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
48
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
49
- - **Container OCR**: Extract shipping container numbers accurately from images.
50
- - **Secure & Fast**: Enterprise-grade encryption and sub-second response times.
57
+ - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
58
+ - **National ID OCR**: Support for ID cards with automatic field mapping.
59
+ - **Driver License OCR**: Extract vehicle class, license number, and personal details.
60
+ - **Invoice OCR**: Extract invoice number, currency, merchant, customer, and financial totals.
61
+ - **Receipt OCR**: Extract merchants, dates, line items, taxes, and totals for expense management.
62
+ - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
63
+ - **HIN OCR**: Validate and extract Hull Identification Numbers from marine vessels.
64
+ - **Container OCR**: Extract shipping container numbers accurately from images.
65
+ - **Secure & Fast**: Enterprise-grade encryption, SOC2 compliance, and sub-second response times with zero data retention.
51
66
 
52
67
  ## Installation
53
68
 
@@ -59,7 +74,7 @@ pip install structocr
59
74
 
60
75
  ## Quick Start
61
76
 
62
- ### 1. Initialize the Client
77
+ ### 1\. Initialize the Client
63
78
 
64
79
  ```python
65
80
  from structocr import StructOCR
@@ -68,7 +83,7 @@ from structocr import StructOCR
68
83
  client = StructOCR(api_key="sk_live_xxxxxxxx")
69
84
  ```
70
85
 
71
- ### 2. Scan a Passport (Passport OCR)
86
+ ### 2\. Scan a Passport (Passport OCR)
72
87
 
73
88
  ```python
74
89
  # Pass the path to the passport image file
@@ -78,7 +93,7 @@ print(f"Name: {result['data']['name']}")
78
93
  print(f"Passport Number: {result['data']['document_number']}")
79
94
  ```
80
95
 
81
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
96
+ ### 3\. Scan Other Documents and Assets
82
97
 
83
98
  ```python
84
99
  # National ID OCR
@@ -90,9 +105,15 @@ license_data = client.scan_driver_license('./docs/license.jpg')
90
105
  # Invoice OCR
91
106
  invoice_data = client.scan_invoice('./docs/invoice.jpg')
92
107
 
108
+ # Receipt OCR (New in 1.2.0)
109
+ receipt_data = client.scan_receipt('./docs/receipt.jpg')
110
+
93
111
  # VIN OCR
94
112
  vin_data = client.scan_vin('./docs/vin.jpg')
95
113
 
114
+ # HIN OCR (New in 1.2.0)
115
+ hin_data = client.scan_hin('./docs/boat_hin.jpg')
116
+
96
117
  # Container OCR
97
118
  container_data = client.scan_container('./docs/container.jpg')
98
119
  ```
@@ -103,8 +124,8 @@ For full API documentation, response examples, and error codes, please visit the
103
124
 
104
125
  ## Requirements
105
126
 
106
- * Python 3.6+
107
- * `requests` library
127
+ * Python 3.7+
128
+ * `requests` library
108
129
 
109
130
  ## License
110
131
 
@@ -0,0 +1,103 @@
1
+ # StructOCR Python SDK
2
+
3
+ [![PyPI version](https://badge.fury.io/py/structocr.svg)](https://badge.fury.io/py/structocr)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ **The official Python client for [StructOCR](https://structocr.com).**
7
+
8
+ StructOCR is a powerful API tailored for developers to extract structured data from complex documents and physical assets with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **Receipt OCR**, **VIN OCR**, **HIN OCR**, and **Container OCR** into your Python applications in minutes.
9
+
10
+ 👉 **[Get your Free API Key here](https://structocr.com)**
11
+
12
+ -----
13
+
14
+ ## 🚀 What's New in 1.2.0
15
+
16
+ We've massively expanded our expense automation and marine capabilities\! The SDK now natively supports:
17
+
18
+ * **Receipt OCR**: Parse retail and dining receipts to extract merchants, individual line items, taxes, and totals.
19
+ * **HIN OCR**: Extract, parse, and validate Hull Identification Numbers from boats and watercraft.
20
+ * *Previous 1.1.6 additions (Container OCR, VIN OCR, Invoice OCR) remain fully supported.*
21
+
22
+ Check out the [Quick Start](#quick-start) below to see how easy it is to use them!
23
+
24
+ -----
25
+
26
+ ## Features
27
+
28
+ - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
29
+ - **National ID OCR**: Support for ID cards with automatic field mapping.
30
+ - **Driver License OCR**: Extract vehicle class, license number, and personal details.
31
+ - **Invoice OCR**: Extract invoice number, currency, merchant, customer, and financial totals.
32
+ - **Receipt OCR**: Extract merchants, dates, line items, taxes, and totals for expense management.
33
+ - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
34
+ - **HIN OCR**: Validate and extract Hull Identification Numbers from marine vessels.
35
+ - **Container OCR**: Extract shipping container numbers accurately from images.
36
+ - **Secure & Fast**: Enterprise-grade encryption, SOC2 compliance, and sub-second response times with zero data retention.
37
+
38
+ ## Installation
39
+
40
+ Install the package via pip:
41
+
42
+ ```bash
43
+ pip install structocr
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ### 1\. Initialize the Client
49
+
50
+ ```python
51
+ from structocr import StructOCR
52
+
53
+ # Initialize with your API Key
54
+ client = StructOCR(api_key="sk_live_xxxxxxxx")
55
+ ```
56
+
57
+ ### 2\. Scan a Passport (Passport OCR)
58
+
59
+ ```python
60
+ # Pass the path to the passport image file
61
+ result = client.scan_passport('./docs/passport_sample.jpg')
62
+
63
+ print(f"Name: {result['data']['name']}")
64
+ print(f"Passport Number: {result['data']['document_number']}")
65
+ ```
66
+
67
+ ### 3\. Scan Other Documents and Assets
68
+
69
+ ```python
70
+ # National ID OCR
71
+ id_data = client.scan_national_id('./docs/id_card.png')
72
+
73
+ # Driver License OCR
74
+ license_data = client.scan_driver_license('./docs/license.jpg')
75
+
76
+ # Invoice OCR
77
+ invoice_data = client.scan_invoice('./docs/invoice.jpg')
78
+
79
+ # Receipt OCR (New in 1.2.0)
80
+ receipt_data = client.scan_receipt('./docs/receipt.jpg')
81
+
82
+ # VIN OCR
83
+ vin_data = client.scan_vin('./docs/vin.jpg')
84
+
85
+ # HIN OCR (New in 1.2.0)
86
+ hin_data = client.scan_hin('./docs/boat_hin.jpg')
87
+
88
+ # Container OCR
89
+ container_data = client.scan_container('./docs/container.jpg')
90
+ ```
91
+
92
+ ## Documentation
93
+
94
+ For full API documentation, response examples, and error codes, please visit the [StructOCR Developer Docs](https://www.structocr.com/developers?ref=github).
95
+
96
+ ## Requirements
97
+
98
+ * Python 3.7+
99
+ * `requests` library
100
+
101
+ ## License
102
+
103
+ MIT License. See [LICENSE](https://opensource.org/licenses/MIT) for details.
@@ -2,8 +2,8 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="structocr",
5
- version="1.1.5",
6
- description="The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, VIN and Container OCR.",
5
+ version="1.2.0",
6
+ description="The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, Receipts, VIN, HIN and Container OCR.",
7
7
  long_description=open("README.md").read(),
8
8
  long_description_content_type="text/markdown",
9
9
 
@@ -0,0 +1,5 @@
1
+ __version__ = "1.2.0"
2
+
3
+ from .client import StructOCR
4
+
5
+ __all__ = ['StructOCR']
@@ -21,7 +21,7 @@ class StructOCR:
21
21
  self.session.headers.update({
22
22
  "x-api-key": self.api_key,
23
23
  "Content-Type": "application/json",
24
- "User-Agent": "StructOCR-Python/1.1.5"
24
+ "User-Agent": "StructOCR-Python/1.2.0"
25
25
  })
26
26
 
27
27
  def _post_image(self, endpoint, file_path):
@@ -107,4 +107,22 @@ class StructOCR:
107
107
  Returns: Structured JSON data.
108
108
  """
109
109
  # Endpoint: /v1/container (这里假设你的后端路由是 container,如果不同请替换)
110
- return self._post_image('container', file_path)
110
+ return self._post_image('container', file_path)
111
+
112
+ def scan_hin(self, file_path):
113
+ """
114
+ Scan a Hull Identification Number (HIN) from a boat or watercraft.
115
+ path: Path to the HIN image file.
116
+ Returns: Structured JSON data.
117
+ """
118
+ # Endpoint: /v1/hin
119
+ return self._post_image('hin', file_path)
120
+
121
+ def scan_receipt(self, file_path):
122
+ """
123
+ Scan a Retail/Dining Receipt for expense extraction.
124
+ path: Path to the receipt image file.
125
+ Returns: Structured JSON data.
126
+ """
127
+ # Endpoint: /v1/receipt
128
+ return self._post_image('receipt', file_path)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structocr
3
- Version: 1.1.5
4
- Summary: The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, VIN and Container OCR.
3
+ Version: 1.2.0
4
+ Summary: The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice, Receipts, VIN, HIN and Container OCR.
5
5
  Home-page: https://structocr.com
6
6
  Author: StructOCR Team
7
7
  Author-email: support@structocr.com
@@ -27,7 +27,6 @@ Dynamic: requires-dist
27
27
  Dynamic: requires-python
28
28
  Dynamic: summary
29
29
 
30
-
31
30
  # StructOCR Python SDK
32
31
 
33
32
  [![PyPI version](https://badge.fury.io/py/structocr.svg)](https://badge.fury.io/py/structocr)
@@ -35,19 +34,35 @@ Dynamic: summary
35
34
 
36
35
  **The official Python client for [StructOCR](https://structocr.com).**
37
36
 
38
- StructOCR is a powerful API tailored for developers to extract structured data from identity documents with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **VIN OCR**, and **Container OCR** into your Python applications in minutes.
37
+ StructOCR is a powerful API tailored for developers to extract structured data from complex documents and physical assets with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **Receipt OCR**, **VIN OCR**, **HIN OCR**, and **Container OCR** into your Python applications in minutes.
39
38
 
40
39
  👉 **[Get your Free API Key here](https://structocr.com)**
41
40
 
41
+ -----
42
+
43
+ ## 🚀 What's New in 1.2.0
44
+
45
+ We've massively expanded our expense automation and marine capabilities\! The SDK now natively supports:
46
+
47
+ * **Receipt OCR**: Parse retail and dining receipts to extract merchants, individual line items, taxes, and totals.
48
+ * **HIN OCR**: Extract, parse, and validate Hull Identification Numbers from boats and watercraft.
49
+ * *Previous 1.1.6 additions (Container OCR, VIN OCR, Invoice OCR) remain fully supported.*
50
+
51
+ Check out the [Quick Start](#quick-start) below to see how easy it is to use them!
52
+
53
+ -----
54
+
42
55
  ## Features
43
56
 
44
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
45
- - **National ID OCR**: Support for ID cards with automatic field mapping.
46
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
47
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
48
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
49
- - **Container OCR**: Extract shipping container numbers accurately from images.
50
- - **Secure & Fast**: Enterprise-grade encryption and sub-second response times.
57
+ - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
58
+ - **National ID OCR**: Support for ID cards with automatic field mapping.
59
+ - **Driver License OCR**: Extract vehicle class, license number, and personal details.
60
+ - **Invoice OCR**: Extract invoice number, currency, merchant, customer, and financial totals.
61
+ - **Receipt OCR**: Extract merchants, dates, line items, taxes, and totals for expense management.
62
+ - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
63
+ - **HIN OCR**: Validate and extract Hull Identification Numbers from marine vessels.
64
+ - **Container OCR**: Extract shipping container numbers accurately from images.
65
+ - **Secure & Fast**: Enterprise-grade encryption, SOC2 compliance, and sub-second response times with zero data retention.
51
66
 
52
67
  ## Installation
53
68
 
@@ -59,7 +74,7 @@ pip install structocr
59
74
 
60
75
  ## Quick Start
61
76
 
62
- ### 1. Initialize the Client
77
+ ### 1\. Initialize the Client
63
78
 
64
79
  ```python
65
80
  from structocr import StructOCR
@@ -68,7 +83,7 @@ from structocr import StructOCR
68
83
  client = StructOCR(api_key="sk_live_xxxxxxxx")
69
84
  ```
70
85
 
71
- ### 2. Scan a Passport (Passport OCR)
86
+ ### 2\. Scan a Passport (Passport OCR)
72
87
 
73
88
  ```python
74
89
  # Pass the path to the passport image file
@@ -78,7 +93,7 @@ print(f"Name: {result['data']['name']}")
78
93
  print(f"Passport Number: {result['data']['document_number']}")
79
94
  ```
80
95
 
81
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
96
+ ### 3\. Scan Other Documents and Assets
82
97
 
83
98
  ```python
84
99
  # National ID OCR
@@ -90,9 +105,15 @@ license_data = client.scan_driver_license('./docs/license.jpg')
90
105
  # Invoice OCR
91
106
  invoice_data = client.scan_invoice('./docs/invoice.jpg')
92
107
 
108
+ # Receipt OCR (New in 1.2.0)
109
+ receipt_data = client.scan_receipt('./docs/receipt.jpg')
110
+
93
111
  # VIN OCR
94
112
  vin_data = client.scan_vin('./docs/vin.jpg')
95
113
 
114
+ # HIN OCR (New in 1.2.0)
115
+ hin_data = client.scan_hin('./docs/boat_hin.jpg')
116
+
96
117
  # Container OCR
97
118
  container_data = client.scan_container('./docs/container.jpg')
98
119
  ```
@@ -103,8 +124,8 @@ For full API documentation, response examples, and error codes, please visit the
103
124
 
104
125
  ## Requirements
105
126
 
106
- * Python 3.6+
107
- * `requests` library
127
+ * Python 3.7+
128
+ * `requests` library
108
129
 
109
130
  ## License
110
131
 
structocr-1.1.5/README.md DELETED
@@ -1,82 +0,0 @@
1
-
2
- # StructOCR Python SDK
3
-
4
- [![PyPI version](https://badge.fury.io/py/structocr.svg)](https://badge.fury.io/py/structocr)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
-
7
- **The official Python client for [StructOCR](https://structocr.com).**
8
-
9
- StructOCR is a powerful API tailored for developers to extract structured data from identity documents with high accuracy. This SDK helps you integrate **Passport OCR**, **National ID OCR**, **Driver License OCR**, **Invoice OCR**, **VIN OCR**, and **Container OCR** into your Python applications in minutes.
10
-
11
- 👉 **[Get your Free API Key here](https://structocr.com)**
12
-
13
- ## Features
14
-
15
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
16
- - **National ID OCR**: Support for ID cards with automatic field mapping.
17
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
18
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
19
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
20
- - **Container OCR**: Extract shipping container numbers accurately from images.
21
- - **Secure & Fast**: Enterprise-grade encryption and sub-second response times.
22
-
23
- ## Installation
24
-
25
- Install the package via pip:
26
-
27
- ```bash
28
- pip install structocr
29
- ```
30
-
31
- ## Quick Start
32
-
33
- ### 1. Initialize the Client
34
-
35
- ```python
36
- from structocr import StructOCR
37
-
38
- # Initialize with your API Key
39
- client = StructOCR(api_key="sk_live_xxxxxxxx")
40
- ```
41
-
42
- ### 2. Scan a Passport (Passport OCR)
43
-
44
- ```python
45
- # Pass the path to the passport image file
46
- result = client.scan_passport('./docs/passport_sample.jpg')
47
-
48
- print(f"Name: {result['data']['name']}")
49
- print(f"Passport Number: {result['data']['document_number']}")
50
- ```
51
-
52
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
53
-
54
- ```python
55
- # National ID OCR
56
- id_data = client.scan_national_id('./docs/id_card.png')
57
-
58
- # Driver License OCR
59
- license_data = client.scan_driver_license('./docs/license.jpg')
60
-
61
- # Invoice OCR
62
- invoice_data = client.scan_invoice('./docs/invoice.jpg')
63
-
64
- # VIN OCR
65
- vin_data = client.scan_vin('./docs/vin.jpg')
66
-
67
- # Container OCR
68
- container_data = client.scan_container('./docs/container.jpg')
69
- ```
70
-
71
- ## Documentation
72
-
73
- For full API documentation, response examples, and error codes, please visit the [StructOCR Developer Docs](https://www.structocr.com/developers?ref=github).
74
-
75
- ## Requirements
76
-
77
- * Python 3.6+
78
- * `requests` library
79
-
80
- ## License
81
-
82
- MIT License. See [LICENSE](https://opensource.org/licenses/MIT) for details.
@@ -1,5 +0,0 @@
1
- __version__ = "1.1.5"
2
-
3
- from .client import StructOCR
4
-
5
- __all__ = ['StructOCR']
File without changes