Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AnnotationSchema
✓ from superannotate_schemas import AnnotationSchema
✗ from superannotate_schemas import AnnotationSchema
Basic usage to validate an annotation against the schema.
from superannotate_schemas import AnnotationSchema
import os
api_key = os.environ.get('SUPERANNOTATE_API_KEY', '')
# Validate a sample annotation
annotation = {"type": "polygon", "points": [[0,0],[10,0],[10,10],[0,10]]}
is_valid = AnnotationSchema.validate(annotation)
print(is_valid)
Debug
Known issues
gotchaImport path uses underscores: superannotate_schemas (not superannotate.schemas). Many users mistakenly use the dot notation due to the package name.fixUse from superannotate_schemas import ...
affects: all
gotchaValidation methods return boolean, not raise exceptions by default. To raise on invalid data, use .validate_or_raise().fixCall AnnotationSchema.validate_or_raise(annotation) instead of AnnotationSchema.validate(annotation) to get detailed error.
affects: >=1.0.0
deprecatedSome older schema classes like 'OldAnnotationSchema' are deprecated and will be removed in a future version.fixMigrate to AnnotationSchema or ExportSchema.
affects: <1.0.0, if applicable
Upgrade
Version history
1.0.49latest on PyPI · released Jun 6, 2024
Audit
Dependencies
jsonschemarequiredRequired for schema validation at runtime