Skip to main content

Tools and utilities to read embedded JSON data from OV Vision Systems

Project description

Overview JPEG Tools

Tools and utilities to read embedded JSON data from OV Vision Systems.

Installation

pip install overview-jpeg-tools

Requirements

  • Python 3.8+

Quick Start

from overview_jpeg_tools import JpegJsonReader, NoMetadataError

# Extract JSON data from an image
reader = JpegJsonReader("path/to/image.jpg")

try:
    data = reader.extract_json()
    print(f"Found embedded data: {data}")
except NoMetadataError:
    print("No embedded JSON found")

Usage

Extract JSON from JPEG

from overview_jpeg_tools import JpegJsonReader, NoMetadataError, MetadataDecodingError

# From file path
reader = JpegJsonReader("/path/to/image.jpg")
try:
    json_data = reader.extract_json()
except NoMetadataError:
    print("Image contains no JSON metadata")
except MetadataDecodingError as e:
    print(f"Failed to decode metadata: {e}")

# From bytes
with open("image.jpg", "rb") as f:
    image_bytes = f.read()
reader = JpegJsonReader(image_bytes)
json_data = reader.extract_json()

Check for Embedded JSON

reader = JpegJsonReader("image.jpg")
if reader.has_embedded_json():
    data = reader.extract_json()

Access Raw Image Data

reader = JpegJsonReader("image.jpg")
raw_bytes = reader.to_bytes()

API Reference

JpegJsonReader

Main class for reading JSON data from JPEG images.

Constructor

JpegJsonReader(source: Union[str, Path, bytes, BytesIO])
  • source: File path (str/Path) or binary JPEG data (bytes/BytesIO)

Raises:

  • ValueError: If not a valid JPEG image
  • FileNotFoundError: If file path doesn't exist

Methods

  • extract_json() -> Dict[str, Any]: Extract and return embedded JSON data
    • Raises:
      • NoMetadataError: If the image contains no JSON metadata
      • MetadataDecodingError: If metadata exists but could not be decoded
  • has_embedded_json() -> bool: Check if the image contains embedded JSON data
  • to_bytes() -> bytes: Get the raw image data as bytes

Properties

  • image_data: bytes: The raw JPEG image data
  • source_path: Optional[Path]: The original file path if loaded from disk

Exceptions

  • NoMetadataError: Raised when the image contains no JSON metadata
  • MetadataDecodingError: Raised when metadata exists but could not be decoded properly (e.g., decompression or parsing failures)

License

Proprietary - Copyright (c) 2024-2025 Overview Corporation. All rights reserved.

Support

For support, contact: support@overview.ai

Website: https://overview.ai

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

overview_jpeg_tools-1.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

overview_jpeg_tools-1.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file overview_jpeg_tools-1.1.1.tar.gz.

File metadata

  • Download URL: overview_jpeg_tools-1.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for overview_jpeg_tools-1.1.1.tar.gz
Algorithm Hash digest
SHA256 57311556b95dbc87792b457ddd3a7c888a4745e5b16a1c1827ec073eeb5be734
MD5 1329c54d75b56918baba14f9a30a806b
BLAKE2b-256 76b74901dafee13b445f6a434ccd0dd965d45ddf5c9e9feab1847350419e0c66

See more details on using hashes here.

Provenance

The following attestation bundles were made for overview_jpeg_tools-1.1.1.tar.gz:

Publisher: publish.yml on OverviewCorporation/overview-jpeg-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file overview_jpeg_tools-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for overview_jpeg_tools-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 871c35acd2aa9eb5ed2fc04a98e121cc5f7ff91cbb5413b60c8b4ca850a3e468
MD5 fafbefa6c95db10d38022d211bfed691
BLAKE2b-256 f42862af13294c0e66db22276b6daf5fefe8d41ff4df561297817c46600ba4cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for overview_jpeg_tools-1.1.1-py3-none-any.whl:

Publisher: publish.yml on OverviewCorporation/overview-jpeg-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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