Managing Favorites
Tutorial
Managing Favorites
Bookmark and organize your frequently used resources
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 — ParametersUSERNAME = "_FILL_ME_IN_" # Set your email before running# Cell 2 — Connectfrom graph_olap import GraphOLAPClientclient = GraphOLAPClient(username=USERNAME)
# Cell 3 — Provisionfrom notebook_setup import provisionpersonas, 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 favoritesfavorite = 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 favoritesfavorites = client.favorites.list()for fav in favorites: print(f"{fav.resource_type}: {fav.resource_id}")
3
Managing Favorites
Update and remove bookmarks
# Filter by typemapping_favs = client.favorites.list(resource_type="mapping")print(f"Mapping favorites: {len(mapping_favs)}")# Remove a favoriteclient.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