SuperAnnotate Schemas
raw JSON → 1.0.49 verified Sat May 09 auth: no python
A library providing JSON schemas for SuperAnnotate's data formats, used for validating annotations, exports, and imports. Current version: 1.0.49. Release cadence is irregular, with frequent minor updates.
pip install superannotate-schemas Common errors
error ModuleNotFoundError: No module named 'superannotate' ↓
cause Incorrect import path using dot instead of underscore.
fix
pip install superannotate-schemas and then from superannotate_schemas import ...
error jsonschema.exceptions.ValidationError: ... ↓
cause Annotation does not match the JSON schema. Usually due to missing required fields or wrong data types.
fix
Check the annotation structure against the schema definition. Use validate_or_raise to see detailed error.
Warnings
gotcha Import path uses underscores: superannotate_schemas (not superannotate.schemas). Many users mistakenly use the dot notation due to the package name. ↓
fix Use from superannotate_schemas import ...
gotcha Validation methods return boolean, not raise exceptions by default. To raise on invalid data, use .validate_or_raise(). ↓
fix Call AnnotationSchema.validate_or_raise(annotation) instead of AnnotationSchema.validate(annotation) to get detailed error.
deprecated Some older schema classes like 'OldAnnotationSchema' are deprecated and will be removed in a future version. ↓
fix Migrate to AnnotationSchema or ExportSchema.
Imports
- AnnotationSchema wrong
from superannotate.schemas import AnnotationSchemacorrectfrom superannotate_schemas import AnnotationSchema - ExportSchema wrong
import superannotate_schemas.ExportSchemacorrectfrom superannotate_schemas import ExportSchema
Quickstart
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)