Toucan
Interact with toucan toco app
Website

Connect

You must Connect before any other methods
1
import naas_drivers
2
url = "http://toucan.bobapp.ai/"
3
username = "[email protected]"
4
password = "test"
5
naas_drivers.toucan.connect(url, username, password)
Copied!

Version

get the current version of app
1
naas_drivers.toucan.get_version()
Copied!

Screenshots

App

1
app_name = "test"
2
naas_drivers.toucan.screenshots_app(app_name)
Copied!

All App

1
naas_drivers.toucan.screenshots_app_all()
Copied!

Users

Analytics

1
analytic = naas_drivers.toucan.get_users_analytics()
Copied!

Get all

1
analytic = naas_drivers.toucan.get_users()
Copied!

Small Apps

Report

1
app_name = "test"
2
report = naas_drivers.toucan.get_app_reports(app_name)
Copied!

Report Ids

1
app_name = "test"
2
report_ids = naas_drivers.toucan.get_app_reports_ids(app_name)
Copied!

Report by name

1
app_name = "test"
2
report = naas_drivers.toucan.get_report_by_name(app_name)
Copied!

Metadata

1
app_name = "test"
2
stage="staging"
3
metadata = naas_drivers.toucan.get_metadata(app_name, stage)
Copied!

Data domain

1
app_name = "test"
2
domain = "101"
3
stage="staging"
4
data = naas_drivers.toucan.get_data(app_name, domain, stage)
Copied!

Data

1
app_name = "test"
2
data = naas_drivers.toucan.get_data(app_name)
Copied!

Config

1
app_name = "test"
2
config = naas_drivers.toucan.get_app_config(app_name)
Copied!

Download Config

1
app_name = "test"
2
format_file = "front_config"
3
# format_file can be :
4
# etl_config
5
# report
6
# dashboard-Group
7
# augment.py
8
# preprocess_validation
9
# permissions.py
10
# permissions_config
11
# notifications_handlers.py
12
stage = "staging"
13
naas_drivers.toucan.download_app_config(app_name, format_file, stage)
Copied!

Load config

1
app_name = "test"
2
stage = "staging"
3
config = naas_drivers.toucan.load_conf(app_name, stage)
Copied!

Load Operations

1
app_name = "test"
2
stage = "staging"
3
notification = False,
4
operations = [
5
"preprocess_data_sources",
6
"populate_basemaps",
7
"populate_reports",
8
"populate_dashboards",
9
"populate_permissions",
10
]
11
config = naas_drivers.toucan.load_conf(app_name, stage, notification, operations)
Copied!

Create small app

1
app_name = "test"
2
app_id = "test"
3
config = naas_drivers.toucan.create_small_app(app_name, app_id)
Copied!

Send config

1
app_name = "test"
2
file_upload = "/path/to/my/file"
3
stage = "staging"
4
format_file = "front_config"
5
# format_file can be :
6
# etl_config
7
# report
8
# dashboard-Group
9
# augment.py
10
# preprocess_validation
11
# permissions.py
12
# permissions_config
13
# notifications_handlers.py
14
naas_drivers.toucan.send_app_config(
15
app_name,
16
file_upload,
17
format_file=format_file,
18
stage=stage
19
)
Copied!

Release config

1
app_name = "test"
2
stage = "staging"
3
naas_drivers.toucan.release_conf(app_name, stage)
Copied!

Deploy app

1
app_name = "test"
2
stage = "staging"
3
operations=[
4
"preprocess_data_sources",
5
"populate_reports",
6
"populate_dashboards",
7
"release_design",
8
]
9
force=True
10
naas_drivers.toucan.deploy_app(app_name, stage, operations, force)
Copied!

Embed

1
small_app = "test"
2
slide = "101"
3
hosts=None # can be specific for security
4
mode="webcomponent" #can be iframe or webcomponent
5
height="800px"
6
naas_drivers.toucan.embed(small_app, slide, hosts, mode, height)
Copied!

Craft token

1
username = "[email protected]"
2
access = ("test", "viewer")
3
naas_drivers.toucan.craft_token(username, access)
Copied!

Official documentation

Documentation