Skip to content

Commit adf6f16

Browse files
authored
Merge branch 'develop' into get_things_by_id
2 parents c639d1d + 6fc1ba8 commit adf6f16

File tree

4 files changed

+76
-30
lines changed

4 files changed

+76
-30
lines changed

README.rst

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,41 @@ Authentication
2727

2828
.. code-block:: python
2929
30-
>>> from superannotate import SAClient
31-
# by environment variable SA_TOKEN
32-
>>> sa_client = SAClient()
33-
# by token
34-
>>> sa_client = SAClient(token='<team token>')
35-
# by config file
36-
# default path is ~/.superannotate/config.json
37-
>>> sa_client = SAClient(config_path='~/.superannotate/dev_config.json')
30+
from superannotate import SAClient
31+
# by environment variable SA_TOKEN
32+
sa_client = SAClient()
33+
# by token
34+
sa_client = SAClient(token='<team token>')
35+
# by config file
36+
# default path is ~/.superannotate/config.json
37+
sa_client = SAClient(config_path='~/.superannotate/dev_config.json')
3838
3939
Using superannotate
4040
-------------------
4141

4242
.. code-block:: python
4343
44-
>>> from superannotate import SAClient
45-
>>> sa_client =SAClient()
46-
>>> project = 'Dogs'
47-
>>> sa_client.create_project(
44+
from superannotate import SAClient
45+
46+
47+
sa_client =SAClient()
48+
49+
project = 'Dogs'
50+
51+
sa_client.create_project(
4852
project_name=project,
4953
project_description='Test project generated via SDK',
5054
project_type='Vector'
5155
)
52-
>>> sa_client.create_annotation_class(
53-
project=project,
54-
name='dog',
55-
color='#F9E0FA',
56-
class_type='tag'
57-
)
58-
>>> sa_client.attach_items(
56+
57+
sa_client.create_annotation_class(
58+
project=project,
59+
name='dog',
60+
color='#F9E0FA',
61+
class_type='tag'
62+
)
63+
64+
sa_client.attach_items(
5965
project=project,
6066
attachments=[
6167
{
@@ -64,7 +70,8 @@ Using superannotate
6470
}
6571
]
6672
)
67-
>>> sa_client.upload_annotations(
73+
74+
sa_client.upload_annotations(
6875
project=project,
6976
annotations=[
7077
{
@@ -75,7 +82,8 @@ Using superannotate
7582
}
7683
]
7784
)
78-
>>> sa_client.get_annotations(project=project, items=['dog.jpeg'])
85+
86+
sa_client.get_annotations(project=project, items=['dog.jpeg'])
7987
8088
Installation
8189
------------

docs/source/index.rst

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,49 @@ SuperAnnotate Python SDK allows access to the platform without web browser:
2929

3030
.. code-block:: python
3131
32-
from superannotate import SAClient
33-
34-
sa = SAClient()
35-
36-
sa.create_project("Example Project 1", "example", "Vector")
37-
38-
sa.upload_images_from_folder_to_project("Example Project 1", "<path_to_my_images_folder>")
32+
from superannotate import SAClient
33+
34+
35+
sa_client =SAClient()
36+
37+
project = 'Dogs'
38+
39+
sa_client.create_project(
40+
project_name=project,
41+
project_description='Test project generated via SDK',
42+
project_type='Vector'
43+
)
44+
45+
sa_client.create_annotation_class(
46+
project=project,
47+
name='dog',
48+
color='#F9E0FA',
49+
class_type='tag'
50+
)
51+
52+
sa_client.attach_items(
53+
project=project,
54+
attachments=[
55+
{
56+
'url': 'https://drive.google.com/uc?export=download&id=1ipOrZNSTlPUkI_hnrW9aUD5yULqqq5Vl',
57+
'name': 'dog.jpeg'
58+
}
59+
]
60+
)
61+
62+
sa_client.upload_annotations(
63+
project=project,
64+
annotations=[
65+
{
66+
'metadata': {'name': 'dog.jpeg'},
67+
'instances': [
68+
{'type': 'tag', 'className': 'dog'}
69+
]
70+
}
71+
]
72+
)
73+
74+
sa_client.get_annotations(project=project, items=['dog.jpeg'])
3975
4076
----------
4177

@@ -50,7 +86,7 @@ SDK is available on PyPI:
5086
pip install superannotate
5187
5288
53-
The package officially supports Python 3.6+ and was tested under Linux and
89+
The package officially supports Python 3.7+ and was tested under Linux and
5490
Windows (`Anaconda <https://www.anaconda.com/products/individual#windows>`_) platforms.
5591

5692
For more detailed installation steps and package usage please have a look at

src/superannotate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import sys
33

44

5-
__version__ = "4.4.7dev7"
5+
__version__ = "4.4.8dev2"
6+
67

78

89
sys.path.append(os.path.split(os.path.realpath(__file__))[0])

src/superannotate/lib/core/usecases/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import platform
44
import tempfile
55
import time
6+
import platform
67
import zipfile
78
from pathlib import Path
89
from tempfile import TemporaryDirectory

0 commit comments

Comments
 (0)