Skip to content

Commit 04c5cc4

Browse files
authored
Merge pull request #22 from superannotateai/jsonschemas
Wrapped jsonschema
2 parents 52424b1 + 1ed6d9e commit 04c5cc4

File tree

80 files changed

+6944
-18264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+6944
-18264
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,3 @@ This project is SuperAnnotate annotations JSON schema generator.
99
```
1010
$ pip install superannotate_schemas
1111
```
12-
13-
## Example
14-
```
15-
$ superannotate_schema validate <annotation_path>
16-
$ superannotate_schema validate <annotation_path>, <annotation_path>
17-
```
18-
- To print validation report set --verbose True
19-
- To store reports in the file set --report-path

requirements.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
dnspython==2.1.0
2-
fire==0.4.0
3-
idna==3.3
4-
pydantic==1.8.2
5-
six==1.16.0
6-
termcolor==1.1.0
7-
typing-extensions==3.10.0.2
8-
typingx==0.5.3
9-
pydantic[email]
10-
email-validator>=1.0.3
1+
attrs~=23.1.0
2+
pyrsistent~=0.20.0
3+
six~=1.16.0
4+
twisted~=23.10.0
Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
import os
2-
import sys
1+
"""
2+
An implementation of JSON Schema for Python
33
4-
WORKING_DIR = os.path.split(os.path.realpath(__file__))[0]
5-
sys.path.append(WORKING_DIR)
4+
The main functionality is provided by the validator classes for each of the
5+
supported JSON Schema versions.
66
7-
from superannotate_schemas.validators import AnnotationValidators
7+
Most commonly, `validate` is the quickest way to simply validate a given
8+
instance under a schema, and will create a validator for you.
9+
"""
810

9-
__version__ = '1.0.45dev5'
11+
from superannotate_schemas.exceptions import (
12+
ErrorTree, FormatError, RefResolutionError, SchemaError, ValidationError
13+
)
14+
from superannotate_schemas._format import (
15+
FormatChecker,
16+
draft3_format_checker,
17+
draft4_format_checker,
18+
draft6_format_checker,
19+
draft7_format_checker,
20+
)
21+
from superannotate_schemas._types import TypeChecker
22+
from superannotate_schemas.validators import (
23+
Draft3Validator,
24+
Draft4Validator,
25+
Draft6Validator,
26+
Draft7Validator,
27+
RefResolver,
28+
validate,
29+
)
1030

11-
__all__ = [
12-
"__version__",
13-
"AnnotationValidators"
14-
]
31+
try:
32+
from importlib import metadata
33+
except ImportError: # for Python<3.8
34+
import importlib_metadata as metadata
35+
36+
__version__ = '1.0.46b1'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from superannotate_schemas.cli import main
2+
main()

0 commit comments

Comments
 (0)