Skip to main content

Quickstart

This page is for the new user who wants proof that the SDK works in their own Viya environment.

60-second path

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 client closes synchronous resources
  • async with SVIClient(...) as client or await 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​

7. Next steps​