Skip to content

Managing Favorites

Tutorial

Managing Favorites

Bookmark and organize your frequently used resources

10 min Beginner
FavoritesBookmarksOrganization

What You'll Learn

  • Adding Favorites - Bookmark mappings and instances
  • Listing Favorites - View your bookmarked resources
  • Filtering - Filter favorites by resource type
  • Quick Access - Rapidly access favorite resources
# Cell 1 — Parameters
USERNAME = "_FILL_ME_IN_" # Set your email before running
# Cell 2 — Connect
from graph_olap import GraphOLAPClient
client = GraphOLAPClient(username=USERNAME)
# Cell 3 — Provision
from notebook_setup import provision
personas, conn = provision(USERNAME)
analyst = personas["analyst"]
admin = personas["admin"]
ops = personas["ops"]
client = analyst
mapping = client.mappings.list().items[0]
print(f"Connected to: {client._config.api_url}")
print(f"Using mapping: {mapping.name} (id={mapping.id})")
1

Adding Favorites

Bookmark any resource

# Add a mapping to favorites
favorite = client.favorites.add(
resource_type="mapping",
resource_id=mapping.id,
)
print(f"Added to favorites: {favorite.resource_type} {favorite.resource_id}")
2

Viewing Favorites

List and filter bookmarks

# List all favorites
favorites = client.favorites.list()
for fav in favorites:
print(f"{fav.resource_type}: {fav.resource_id}")
3

Managing Favorites

Update and remove bookmarks

# Filter by type
mapping_favs = client.favorites.list(resource_type="mapping")
print(f"Mapping favorites: {len(mapping_favs)}")
# Remove a favorite
client.favorites.remove(
resource_type=favorite.resource_type,
resource_id=favorite.resource_id,
)
print(f"Removed favorite: {favorite.resource_type} {favorite.resource_id}")

Key Takeaways

  • Favorite any resource type (mapping, instance)
  • Favorites are identified by (resource_type, resource_id)
  • Filter favorites by resource type
  • Quick access to frequently used resources