This example illustrate how to publish a visualization using a private table. Using private tables requires to create Maps API keys for the visualization. By default it creates a custom Maps API key for all the private tables used in the visualization if not provided.
Read more about Maps API Keys: https://carto.com/developers/auth-api/guides/types-of-API-Keys/
Note: CARTO Account credentials are needed to reproduce this example. https://carto.com/signup
In [1]:
from cartoframes.auth import set_default_credentials
set_default_credentials('creds.json')
In [2]:
from cartoframes.viz import Map, Layer
map_viz = Map(Layer('private_table'))
In [3]:
map_viz.publish(
name='map_private_table',
password='1234',
if_exists='replace')
Out[3]:
The Maps API key can be created in the CARTO Dashboard and provided to the method.
In [4]:
map_viz.publish(
name='map_private_table',
password='1234',
if_exists='replace',
maps_api_key='7rj9ftFsOKUjSotnygh2jg')
Out[4]: