Quickstart
This page is for the new user who wants proof that the SDK works in their own Viya environment.
If you already have SASVI_BASE_URL and SASVI_ACCESS_TOKEN set, the entire setup is
three lines:
import sasvi
client = sasvi.SVIClient.from_env()
print([t.name for t in client.admin.entity_types.list()[:5]])
If those env vars aren't set, follow the full quickstart below.
1. Install
Install the package from PyPI:
python -m pip install --upgrade pip
pip install sasvi
The sasvi command-line tool ships behind an extra, so ask for it if you want the
CLI as well as the library:
pip install "sasvi[cli]"
Contributors working from a clone install the checkout itself:
python -m pip install .
Supported Python versions for this release: 3.11, 3.12, 3.13, and 3.14.
2. Know your environment values
Before you run the code below, collect the real values from your own deployment:
- your Viya
base_url - one supported auth flow
- permission to read entity metadata
Use Before you start if you do not have those yet.
3. Create a client
If you are new to the SDK, start with the interactive auth flow in the Authentication guide. The rest of the docs assume you already have an authenticated client like this:
from sasvi import SVIClient
from sasvi.auth import AuthorizationCodeTokenProvider
client = SVIClient(
base_url="https://viya.example.com",
auth=AuthorizationCodeTokenProvider(open_browser=True),
)
client.verify_connection()
4. Run one connectivity check
entity_types = client.admin.entity_types.list(exclude_unauthorized=False)
print([item.name for item in entity_types[:5]])
Why this is the first check:
- it exercises auth, base URL resolution, and a real service call
- it uses the same metadata call the client uses to verify connectivity
- it does not depend on pre-existing workflow tasks in your environment
Cleanup note:
with SVIClient(...) as clientcloses synchronous resourcesasync with SVIClient(...) as clientorawait client.close_async()performs full async cleanup
5. Use the raw layer too
When you want direct OpenAPI coverage, use client.api.<service>:
response = client.api.sand.get_types(names_only=True)
print(type(response).__name__)
Why you might choose this path:
- you want broad endpoint coverage now
- you already know the SAS service shape
- you want generated request and response models
6. Learn the real values behind the guides
The task guides use placeholders like "<your-entity-type>" and "<your-document-id>" because VI
deployments differ. Use Discover your environment to find
the real names, ids, domains, and list values in your own system.
Original SAS API docs
- SAS authentication getting started
- Data Hub API
- Visual Investigator Alerts API
- Search and Discovery API
- Visual Investigator Workflow API
7. Next steps
- Need a different auth flow: Authentication guide
- Need the environment-specific values behind the examples: Before you start
- Need to discover real ids, names, and codes: Discover your environment
- Need documents: Documents guide
- Need alerts: Alerts guide
- Need search: Search guide
- Need workflows: Workflows guide
- Need configuration: Configuration guide
- Need a focused task snippet: Recipes, 17 short copy-paste snippets.
- Stuck on an error: Troubleshooting or the FAQ.
- Need to match an SDK release to a Viya cadence: Compatibility and Viya cadence
- Need the mental model: Client model