This example illustrates how to publish a layout of map visualizations.
Note: You'll need your CARTO Account credentials to reproduce this example.
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Map, Layer, Layout, basic_style, color_category_style
set_default_credentials('creds.json')
layout_viz = Layout([
Map(Layer('public_table')),
Map(Layer('private_table'))
])
layout_viz.publish(
'layout_public_private_table',
password='1234',
if_exists='replace')
The map has been published. The "cartoframes_997c05771fd4e0916de49826722e51cd" Maps API key with value "7rj9ftFsOKUjSotnygh2jg" is being used for the datasets: "private_table". You can manage your API keys on your account.
{'id': '70057fe9-57ad-4e3c-999f-a086c2a1d494', 'url': 'https://cartoframes-org.carto.com/u/cartoframes/kuviz/70057fe9-57ad-4e3c-999f-a086c2a1d494', 'name': 'layout_public_private_table', 'privacy': 'password'}