Skip to main content

The official Python SDK for StructOCR API - Passport, ID card, Driver License OCR, Invoice and VIN OCR.

Project description

StructOCR Python SDK

PyPI version License: MIT

The official Python client for StructOCR.

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 and VIN OCR into your Python applications in minutes.

👉 Get your Free API Key here

Features

  • Passport OCR API: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
  • National ID OCR: Support for ID cards with automatic field mapping.
  • Driver License OCR: Extract vehicle class, license number, and personal details.
  • Invoice OCR: Extract invoice number, currency, merchant, customer.
  • VIN OCR: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
  • Secure & Fast: Enterprise-grade encryption and sub-second response times.

Installation

Install the package via pip:

pip install structocr

Quick Start

1. Initialize the Client

from structocr import StructOCR

# Initialize with your API Key
client = StructOCR(api_key="sk_live_xxxxxxxx")

2. Scan a Passport (Passport OCR)

# Pass the path to the passport image file
result = client.scan_passport('./docs/passport_sample.jpg')

print(f"Name: {result['data']['name']}")
print(f"Passport Number: {result['data']['document_number']}")

3. Scan a National ID, Driver License, Invoice or VIN

# National ID OCR
id_data = client.scan_national_id('./docs/id_card.png')

# Driver License OCR
license_data = client.scan_driver_license('./docs/license.jpg')

# Invoice OCR
invoice_data = client.scan_invoice('./docs/invoice.jpg')

# VIN OCR
vin_data = client.scan_vin('./docs/vin.jpg')

Documentation

For full API documentation, response examples, and error codes, please visit the StructOCR Developer Docs.

Requirements

  • Python 3.6+
  • requests library

License

MIT License. See LICENSE for details.cd

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structocr-1.1.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structocr-1.1.4-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file structocr-1.1.4.tar.gz.

File metadata

  • Download URL: structocr-1.1.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for structocr-1.1.4.tar.gz
Algorithm Hash digest
SHA256 9fa1075586a31bffe6ae6dc46ba6ee59eb2a30fe4601f01e328b97436366a969
MD5 c040d466e2d7baca26ed45b0cee9a73f
BLAKE2b-256 3d503f3571e3c6fd40064567ce3853269161daf95ba63e2a4caf4495171b8421

See more details on using hashes here.

File details

Details for the file structocr-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: structocr-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for structocr-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb32ac5d1bfba820beb5b6834735d5a44ead116cc8d6e7f6360c74a608782851
MD5 55ad60c6767e855a72fb2a74a9232832
BLAKE2b-256 9609b42239ca0dbf1e57729c66dca83c4b8e52074d777c60428cd39ec9e9f2cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page