forked from kili-technology/kili-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_project_instructions.py
More file actions
30 lines (23 loc) · 994 Bytes
/
update_project_instructions.py
File metadata and controls
30 lines (23 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import click
from kili.client import Kili
@click.command()
@click.option('--api-endpoint', default=None,
help='Endpoint of GraphQL client',
show_default=(
"'KILI_API_ENDPOINT' environment variable or "
"'https://cloud.kili-technology.com/api/label/v2/graphql' if not set"
)
)
def main(api_endpoint):
api_key = input('Enter API KEY: ')
project_id = input('Enter project id: ')
instructions = input(
'Enter link to instructions (leave blank and press [Enter] to disable instructions): ').strip()
if not instructions.startswith('http') and not instructions == '':
raise Exception(
'The link to instructions should be an URL beginning in http:// or https://')
kili = Kili(api_key=api_key, api_endpoint=api_endpoint)
kili.update_properties_in_project(
project_id=project_id, instructions=instructions)
if __name__ == '__main__':
main()