structocr 1.1.6__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.6
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
@@ -34,31 +34,35 @@ Dynamic: summary
34
34
 
35
35
  **The official Python client for [StructOCR](https://structocr.com).**
36
36
 
37
- 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.
38
38
 
39
39
  👉 **[Get your Free API Key here](https://structocr.com)**
40
40
 
41
- ---
41
+ -----
42
42
 
43
- ## 🚀 What's New in 1.1.6
44
- We've massively expanded our logistics and finance capabilities! The SDK now natively supports:
45
- * **Container OCR**: Accurately parse shipping container numbers from images.
46
- * **VIN OCR**: Read Vehicle Identification Numbers from windshields or chassis.
47
- * **Invoice OCR**: Automatically extract invoice numbers, currencies, merchants, and customers.
43
+ ## 🚀 What's New in 1.2.0
48
44
 
49
- Check out the [Quick Start](#3-scan-a-national-id-driver-license-invoice-vin-or-container) below to see how easy it is to use them!
45
+ We've massively expanded our expense automation and marine capabilities\! The SDK now natively supports:
50
46
 
51
- ---
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
+ -----
52
54
 
53
55
  ## Features
54
56
 
55
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
56
- - **National ID OCR**: Support for ID cards with automatic field mapping.
57
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
58
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
59
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
60
- - **Container OCR**: Extract shipping container numbers accurately from images.
61
- - **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.
62
66
 
63
67
  ## Installation
64
68
 
@@ -70,7 +74,7 @@ pip install structocr
70
74
 
71
75
  ## Quick Start
72
76
 
73
- ### 1. Initialize the Client
77
+ ### 1\. Initialize the Client
74
78
 
75
79
  ```python
76
80
  from structocr import StructOCR
@@ -79,7 +83,7 @@ from structocr import StructOCR
79
83
  client = StructOCR(api_key="sk_live_xxxxxxxx")
80
84
  ```
81
85
 
82
- ### 2. Scan a Passport (Passport OCR)
86
+ ### 2\. Scan a Passport (Passport OCR)
83
87
 
84
88
  ```python
85
89
  # Pass the path to the passport image file
@@ -89,7 +93,7 @@ print(f"Name: {result['data']['name']}")
89
93
  print(f"Passport Number: {result['data']['document_number']}")
90
94
  ```
91
95
 
92
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
96
+ ### 3\. Scan Other Documents and Assets
93
97
 
94
98
  ```python
95
99
  # National ID OCR
@@ -101,9 +105,15 @@ license_data = client.scan_driver_license('./docs/license.jpg')
101
105
  # Invoice OCR
102
106
  invoice_data = client.scan_invoice('./docs/invoice.jpg')
103
107
 
108
+ # Receipt OCR (New in 1.2.0)
109
+ receipt_data = client.scan_receipt('./docs/receipt.jpg')
110
+
104
111
  # VIN OCR
105
112
  vin_data = client.scan_vin('./docs/vin.jpg')
106
113
 
114
+ # HIN OCR (New in 1.2.0)
115
+ hin_data = client.scan_hin('./docs/boat_hin.jpg')
116
+
107
117
  # Container OCR
108
118
  container_data = client.scan_container('./docs/container.jpg')
109
119
  ```
@@ -114,8 +124,8 @@ For full API documentation, response examples, and error codes, please visit the
114
124
 
115
125
  ## Requirements
116
126
 
117
- * Python 3.6+
118
- * `requests` library
127
+ * Python 3.7+
128
+ * `requests` library
119
129
 
120
130
  ## License
121
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.6",
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.6"
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.6
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
@@ -34,31 +34,35 @@ Dynamic: summary
34
34
 
35
35
  **The official Python client for [StructOCR](https://structocr.com).**
36
36
 
37
- 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.
38
38
 
39
39
  👉 **[Get your Free API Key here](https://structocr.com)**
40
40
 
41
- ---
41
+ -----
42
42
 
43
- ## 🚀 What's New in 1.1.6
44
- We've massively expanded our logistics and finance capabilities! The SDK now natively supports:
45
- * **Container OCR**: Accurately parse shipping container numbers from images.
46
- * **VIN OCR**: Read Vehicle Identification Numbers from windshields or chassis.
47
- * **Invoice OCR**: Automatically extract invoice numbers, currencies, merchants, and customers.
43
+ ## 🚀 What's New in 1.2.0
48
44
 
49
- Check out the [Quick Start](#3-scan-a-national-id-driver-license-invoice-vin-or-container) below to see how easy it is to use them!
45
+ We've massively expanded our expense automation and marine capabilities\! The SDK now natively supports:
50
46
 
51
- ---
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
+ -----
52
54
 
53
55
  ## Features
54
56
 
55
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
56
- - **National ID OCR**: Support for ID cards with automatic field mapping.
57
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
58
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
59
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
60
- - **Container OCR**: Extract shipping container numbers accurately from images.
61
- - **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.
62
66
 
63
67
  ## Installation
64
68
 
@@ -70,7 +74,7 @@ pip install structocr
70
74
 
71
75
  ## Quick Start
72
76
 
73
- ### 1. Initialize the Client
77
+ ### 1\. Initialize the Client
74
78
 
75
79
  ```python
76
80
  from structocr import StructOCR
@@ -79,7 +83,7 @@ from structocr import StructOCR
79
83
  client = StructOCR(api_key="sk_live_xxxxxxxx")
80
84
  ```
81
85
 
82
- ### 2. Scan a Passport (Passport OCR)
86
+ ### 2\. Scan a Passport (Passport OCR)
83
87
 
84
88
  ```python
85
89
  # Pass the path to the passport image file
@@ -89,7 +93,7 @@ print(f"Name: {result['data']['name']}")
89
93
  print(f"Passport Number: {result['data']['document_number']}")
90
94
  ```
91
95
 
92
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
96
+ ### 3\. Scan Other Documents and Assets
93
97
 
94
98
  ```python
95
99
  # National ID OCR
@@ -101,9 +105,15 @@ license_data = client.scan_driver_license('./docs/license.jpg')
101
105
  # Invoice OCR
102
106
  invoice_data = client.scan_invoice('./docs/invoice.jpg')
103
107
 
108
+ # Receipt OCR (New in 1.2.0)
109
+ receipt_data = client.scan_receipt('./docs/receipt.jpg')
110
+
104
111
  # VIN OCR
105
112
  vin_data = client.scan_vin('./docs/vin.jpg')
106
113
 
114
+ # HIN OCR (New in 1.2.0)
115
+ hin_data = client.scan_hin('./docs/boat_hin.jpg')
116
+
107
117
  # Container OCR
108
118
  container_data = client.scan_container('./docs/container.jpg')
109
119
  ```
@@ -114,8 +124,8 @@ For full API documentation, response examples, and error codes, please visit the
114
124
 
115
125
  ## Requirements
116
126
 
117
- * Python 3.6+
118
- * `requests` library
127
+ * Python 3.7+
128
+ * `requests` library
119
129
 
120
130
  ## License
121
131
 
structocr-1.1.6/README.md DELETED
@@ -1,93 +0,0 @@
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 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.
9
-
10
- 👉 **[Get your Free API Key here](https://structocr.com)**
11
-
12
- ---
13
-
14
- ## 🚀 What's New in 1.1.6
15
- We've massively expanded our logistics and finance capabilities! The SDK now natively supports:
16
- * **Container OCR**: Accurately parse shipping container numbers from images.
17
- * **VIN OCR**: Read Vehicle Identification Numbers from windshields or chassis.
18
- * **Invoice OCR**: Automatically extract invoice numbers, currencies, merchants, and customers.
19
-
20
- Check out the [Quick Start](#3-scan-a-national-id-driver-license-invoice-vin-or-container) below to see how easy it is to use them!
21
-
22
- ---
23
-
24
- ## Features
25
-
26
- - **Passport OCR API**: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
27
- - **National ID OCR**: Support for ID cards with automatic field mapping.
28
- - **Driver License OCR**: Extract vehicle class, license number, and personal details.
29
- - **Invoice OCR**: Extract invoice number, currency, merchant, customer.
30
- - **VIN OCR**: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
31
- - **Container OCR**: Extract shipping container numbers accurately from images.
32
- - **Secure & Fast**: Enterprise-grade encryption and sub-second response times.
33
-
34
- ## Installation
35
-
36
- Install the package via pip:
37
-
38
- ```bash
39
- pip install structocr
40
- ```
41
-
42
- ## Quick Start
43
-
44
- ### 1. Initialize the Client
45
-
46
- ```python
47
- from structocr import StructOCR
48
-
49
- # Initialize with your API Key
50
- client = StructOCR(api_key="sk_live_xxxxxxxx")
51
- ```
52
-
53
- ### 2. Scan a Passport (Passport OCR)
54
-
55
- ```python
56
- # Pass the path to the passport image file
57
- result = client.scan_passport('./docs/passport_sample.jpg')
58
-
59
- print(f"Name: {result['data']['name']}")
60
- print(f"Passport Number: {result['data']['document_number']}")
61
- ```
62
-
63
- ### 3. Scan a National ID, Driver License, Invoice, VIN, or Container
64
-
65
- ```python
66
- # National ID OCR
67
- id_data = client.scan_national_id('./docs/id_card.png')
68
-
69
- # Driver License OCR
70
- license_data = client.scan_driver_license('./docs/license.jpg')
71
-
72
- # Invoice OCR
73
- invoice_data = client.scan_invoice('./docs/invoice.jpg')
74
-
75
- # VIN OCR
76
- vin_data = client.scan_vin('./docs/vin.jpg')
77
-
78
- # Container OCR
79
- container_data = client.scan_container('./docs/container.jpg')
80
- ```
81
-
82
- ## Documentation
83
-
84
- For full API documentation, response examples, and error codes, please visit the [StructOCR Developer Docs](https://www.structocr.com/developers?ref=github).
85
-
86
- ## Requirements
87
-
88
- * Python 3.6+
89
- * `requests` library
90
-
91
- ## License
92
-
93
- MIT License. See [LICENSE](https://opensource.org/licenses/MIT) for details.
@@ -1,5 +0,0 @@
1
- __version__ = "1.1.6"
2
-
3
- from .client import StructOCR
4
-
5
- __all__ = ['StructOCR']
File without changes