Examples
This page is for the practitioner who wants longer walkthroughs than the task guides.
Documentation tiers
Use the docs layers for different questions:
- guides for task-shaped examples you can adapt quickly
- concepts for the mental model behind the handwritten layer
- API reference for the exact bound methods and parameters
- notebooks for broader exploratory flows and longer end-to-end sequences
Notebooks
examples/documents_examples.ipynbfor document, child-document, insight, and workspace flowsexamples/insights_examples.ipynbfor insight cell builders and sheet layout patternsexamples/workspaces_examples.ipynbfor a workspace-focused walkthrough of nodes, relationships, layout, duplication, and cleanupexamples/alerts_examples.ipynbfor alert retrieval, scenario-fired events, and alert creation patternsexamples/admin_examples.ipynbforsasvi.adminmetadata, reference lists, stored GeoJSON shapes, search synonyms, indexing and configuration exportexamples/bulk_examples.ipynbfor bulk document/link upsert and a scoped index jobexamples/custom_endpoints/custom_endpoints_cascading_data.ipynbfor a low-levelsasvi.customcascading-reference-data workflowexamples/custom_endpoints/custom_endpoints_entity_fields.ipynbfor a low-levelsasvi.customworkflow that adds an attribute to an internal entity typeexamples/search_examples.ipynbfor search result hydration and advanced SAND helpersexamples/workflows_examples.ipynbfor workflow task and process-start flows
Running the notebooks
Each notebook builds its client with SVIClient.from_env(), which reads SASVI_BASE_URL
and one set of credentials: SASVI_USERNAME and SASVI_PASSWORD, SASVI_CLIENT_ID and
SASVI_CLIENT_SECRET, or SASVI_ACCESS_TOKEN. TLS verification stays on. For a tenant
with a self-signed certificate, set SASVI_VERIFY_SSL to the path of its CA bundle, or to
false on a test tenant only. Each notebook loads a .env file from the repository root
with python-dotenv when there is one.
Neither python-dotenv nor
Jupyter is a dependency of sasvi, so install all three:
pip install sasvi python-dotenv jupyter
Set the variables in your shell, or put them in .env at the repository root (it is
git-ignored), then start Jupyter from the examples/ directory.
The notebooks are meant to be run cell by cell. Only search_examples.ipynb is read-only.
Every other notebook writes as you go, so run them against a test tenant. They read existing
data but change only objects they create, and their last section deletes those objects. A
few writes cannot be undone:
alerts_examples.ipynbleaves its alert on the tenant, closed, because alerts cannot be deleted.admin_examples.ipynbcreates a reference list, which the API can only archive, not delete.custom_endpoints/custom_endpoints_entity_fields.ipynbadds a field to an entity type for good.
If you stop a notebook before its last section, delete what it created in Visual Investigator.
Companion pages
- Alert creation notebook walkthrough
- Workspace notebook walkthrough
- Custom endpoint cascading-data notebook walkthrough
How to use them
- start with Before You Start if you do not yet know your VI values
- start with Quickstart if you have not connected a client yet
- use the guides when you want the shortest working snippet for one task
- use the notebooks when you want end-to-end sequences instead of focused snippets
- keep the API reference open when you want exact method signatures