This example illustrates how to publish a visualization using a public table. You do not need a Maps API key to visualize a public table within a notebook. However you do need an API Key to publish any visualization, whether its data is public or private.
Read more about API Keys here: https://carto.com/developers/auth-api/guides/types-of-API-Keys/
Note: You'll need your CARTO Account credentials to reproduce this example.
from cartoframes.auth import set_default_credentials
set_default_credentials('creds.json')
from cartoframes.viz import Map, Layer
map_viz = Map(Layer('public_table'))
map_viz.publish(
name='map_public_table',
password=None,
if_exists='replace')
{'id': '61ccd727-9716-4d5d-84a1-490cdd4f4aec', 'url': 'https://cartoframes-org.carto.com/u/cartoframes/kuviz/61ccd727-9716-4d5d-84a1-490cdd4f4aec', 'name': 'map_public_table', 'privacy': 'public'}