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 imageFileNotFoundError: 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 metadataMetadataDecodingError: If metadata exists but could not be decoded
- Raises:
has_embedded_json() -> bool: Check if the image contains embedded JSON datato_bytes() -> bytes: Get the raw image data as bytes
Properties
image_data: bytes: The raw JPEG image datasource_path: Optional[Path]: The original file path if loaded from disk
Exceptions
NoMetadataError: Raised when the image contains no JSON metadataMetadataDecodingError: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57311556b95dbc87792b457ddd3a7c888a4745e5b16a1c1827ec073eeb5be734
|
|
| MD5 |
1329c54d75b56918baba14f9a30a806b
|
|
| BLAKE2b-256 |
76b74901dafee13b445f6a434ccd0dd965d45ddf5c9e9feab1847350419e0c66
|
Provenance
The following attestation bundles were made for overview_jpeg_tools-1.1.1.tar.gz:
Publisher:
publish.yml on OverviewCorporation/overview-jpeg-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overview_jpeg_tools-1.1.1.tar.gz -
Subject digest:
57311556b95dbc87792b457ddd3a7c888a4745e5b16a1c1827ec073eeb5be734 - Sigstore transparency entry: 926796980
- Sigstore integration time:
-
Permalink:
OverviewCorporation/overview-jpeg-tools@2c3a1102a8a3c5723ab077438db1b9c74162767f -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/OverviewCorporation
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c3a1102a8a3c5723ab077438db1b9c74162767f -
Trigger Event:
release
-
Statement type:
File details
Details for the file overview_jpeg_tools-1.1.1-py3-none-any.whl.
File metadata
- Download URL: overview_jpeg_tools-1.1.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
871c35acd2aa9eb5ed2fc04a98e121cc5f7ff91cbb5413b60c8b4ca850a3e468
|
|
| MD5 |
fafbefa6c95db10d38022d211bfed691
|
|
| BLAKE2b-256 |
f42862af13294c0e66db22276b6daf5fefe8d41ff4df561297817c46600ba4cd
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overview_jpeg_tools-1.1.1-py3-none-any.whl -
Subject digest:
871c35acd2aa9eb5ed2fc04a98e121cc5f7ff91cbb5413b60c8b4ca850a3e468 - Sigstore transparency entry: 926796981
- Sigstore integration time:
-
Permalink:
OverviewCorporation/overview-jpeg-tools@2c3a1102a8a3c5723ab077438db1b9c74162767f -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/OverviewCorporation
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c3a1102a8a3c5723ab077438db1b9c74162767f -
Trigger Event:
release
-
Statement type: