Skip to content

Commit 45e1293

Browse files
authored
Merge pull request #24 from superannotateai/develop
Develop
2 parents 536ff41 + d9e8091 commit 45e1293

File tree

81 files changed

+6955
-18267
lines changed

Some content is hidden

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

81 files changed

+6955
-18267
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

setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,35 @@
66
this_directory = Path(__file__).parent
77
long_description = (this_directory / "README.md").read_text()
88

9+
910
def get_version():
1011
init = open(os.path.join(this_directory, 'src', 'superannotate_schemas', '__init__.py')).read()
1112
match = re.search(r'^__version__ = [\'"]([^\'"]+)[\'"]', init, re.M)
1213
if not match:
1314
raise RuntimeError('Unable to find version string.')
1415
return match.group(1)
1516

17+
18+
requirements = []
19+
20+
with open("requirements.txt") as f:
21+
requirements.extend(f.read().splitlines())
22+
1623
setup(
1724
name='superannotate_schemas',
1825
long_description=long_description,
1926
long_description_content_type='text/markdown',
2027
version=get_version(),
2128
package_dir={"": "src"},
2229
packages=find_packages(where="src"),
30+
install_requires=requirements,
2331
description='SuperAnnotate JSON Schemas',
2432
author='Vaghinak Basentsyan',
2533
author_email='vaghinak@superannotate.con',
2634
url='https://www.superannotate.com/',
2735
license='MIT',
2836
description_file="README.md",
2937
entry_points={
30-
'console_scripts': ['superannotate_schemas = superannotate_schemas.bin.app:main']
31-
},
32-
)
38+
'console_scripts': ['superannotate_schemas = superannotate_schemas.bin.app:main']
39+
},
40+
)
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.45'
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.48'
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)