Metadata-Version: 2.4
Name: sasvi
Version: 0.2.1
Summary: Python SDK and CLI for SAS Visual Investigator: task-oriented services over the REST APIs.
Author: SAS Institute Inc.
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/sassoftware/SASVI
Project-URL: Documentation, https://sassoftware.github.io/SASVI/
Project-URL: Changelog, https://github.com/sassoftware/SASVI/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/sassoftware/SASVI/issues
Keywords: sas,visual-investigator,vi,sdk,rest-api,openapi,investigation,alerts
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs<27,>=23.2
Requires-Dist: httpx2<3,>=2.16
Requires-Dist: pydantic<3,>=2.12
Provides-Extra: cli
Requires-Dist: typer<1,>=0.15.4; extra == "cli"
Requires-Dist: click<9,>=8.1; extra == "cli"
Requires-Dist: rich<16,>=13; extra == "cli"
Dynamic: license-file

# sasvi: an easy-to-use SDK for SAS Visual Investigator

`sasvi` is a Python SDK for SAS Visual Investigator. It gives you task-oriented methods for the
common work of an investigation, plus raw wrappers over the REST API for everything else.

```bash
pip install sasvi
```

Needs Python 3.11 or later. [More install options](#installation) ·
[Documentation](https://sassoftware.github.io/SASVI/)

> [!NOTE]
> **`sasvi` is in beta.** Releases are numbered `0.x`, and a minor release (`0.1` to `0.2`) may
> change or remove public API. Every such change is listed in the
> [changelog](https://github.com/sassoftware/SASVI/blob/main/CHANGELOG.md).
> Patch releases only fix bugs, so [pin a minor release](#installation).
> Please report what breaks or is missing through a
> [GitHub issue](https://github.com/sassoftware/SASVI/issues).

## Overview

Covered today: entities, alerts, search, workflows, attachments, workspaces, insight pages,
reference lists, custom endpoints, indexing, and solution configuration.

- [Overview](#overview)
  - [What you can do](#what-you-can-do)
  - [Architecture](#architecture)
  - [Prerequisites](#prerequisites)
  - [Compatibility](#compatibility)
- [Installation](#installation)
  - [Getting Started](#getting-started)
  - [Examples](#examples)
  - [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [License](#license)
- [Third-Party Dependencies](#third-party-dependencies)
- [Additional Resources](#additional-resources)

### What you can do

Start with the task-oriented services:

- **`svi.documents`.** Read and update documents, attachments, child documents, workspaces, and
  insight sheets.
- **`svi.alerts`.** Work with alerts as first-class objects and combine alert APIs with Data
  Hub-backed document updates.
- **`svi.search`.** Search SAND with a more Pythonic query layer and use results as references in
  later operations.
- **`svi.workflows`.** Start processes, inspect tasks, claim or release work, complete actions, and
  work with bound workflow instances.
- **`svi.admin`.** Inspect and update entity metadata, reference lists, relationship types,
  queues, and other solution configuration, and move a whole solution between tenants
  with `svi.admin.config`.
- **`svi.custom`.** Call your own endpoints on the same host with the client's sign-in.

For an endpoint they do not cover, use the raw layer. `svi.api` has one method per published
operation of the `alerts`, `datahub`, `sand`, `workflows`, `files`, `folders` and `transport` APIs.
See [SVIClient and API layers](https://sassoftware.github.io/SASVI/Guides/SVIClient-and-API-Layers/).

### Architecture

![Your code calls SVIClient. It offers task-oriented services and a raw API layer. Both use the generated clients, which call the SAS Visual Investigator REST APIs.](https://raw.githubusercontent.com/sassoftware/SASVI/main/website/static/img/architecture.svg)

More detail: [Runtime architecture](https://sassoftware.github.io/SASVI/concepts/runtime-architecture/).

### Prerequisites

- Python 3.11, 3.12, 3.13, or 3.14.
- A SAS Viya environment with SAS Visual Investigator, and an account that can sign in to it.

### Compatibility

SAS Viya `Stable` releases ship monthly and `LTS` releases ship every 6 months. `sasvi` compatibility
is determined by the API versions of the endpoints it calls. For the SAS APIs themselves, see
[developer.sas.com](https://developer.sas.com).

To find the SAS Viya version you are on, run `%put &=SYSVIYAVERSION;` in a SAS session. See
[Find your SAS Viya version](https://sassoftware.github.io/SASVI/concepts/compatibility-and-viya-cadence/#find-your-sas-viya-version).
To see what your installed `sasvi` was built against, run `sasvi version` or call
`sasvi.compatibility()`.

| sasvi package version | Viya Stable | Viya LTS | Notes |
| --- | --- | --- | --- |
| `0.2.1` | 2026.10 | None yet | Notebook login fix, live-verified on Stable 2026.10, Python 3.11 to 3.14 |
| `0.2.0` | 2026.10 | None yet | Live-verified on Stable 2026.10, Python 3.11 to 3.14 |
| `0.1.0` | 2026.10 | None yet | Initial version, live-verified on Stable 2026.10, Python 3.11 to 3.14 |

See the [full matrix](https://sassoftware.github.io/SASVI/concepts/compatibility-and-viya-cadence/).

## Installation

Install `sasvi` from [PyPI](https://pypi.org/project/sasvi/):

```bash
pip install sasvi
```

To get the `sasvi` command as well, install the `cli` extra:

```bash
pip install "sasvi[cli]"
```

In a project you deploy, pin the minor release:

```bash
pip install "sasvi~=0.2.0"
```

To use `sasvi` from PROC PYTHON, SAS Studio or SAS Intelligent Decisioning, see
[Installing `sasvi` into the SAS Viya Python](https://sassoftware.github.io/SASVI/Guides/sas-viya-python/).

### Getting Started

Create a client:

```python
from sasvi import SVIClient
from sasvi.auth import AuthorizationCodeTokenProvider

svi = SVIClient(
    base_url="https://viya.example.com",
    auth=AuthorizationCodeTokenProvider(open_browser=True),
)

svi.verify_connection()
```

> The [authentication guide](https://sassoftware.github.io/SASVI/Guides/authentication/) covers the other providers.

Use the handwritten capability layer for task-oriented workflows:

```python
# list alerts
alerts = svi.alerts.list(limit=5)

# take the first one
alert = alerts[0]

# read a property
alert.current_score

# add a comment
alert.comments.create(text="Test comment from sasvi.")
```

Use the raw generated layer when you want direct endpoint access:

```python
workflows = svi.api.workflows.get_workflows()
types = svi.api.sand.get_types(names_only=True)
```

### Examples

Ten [example notebooks](https://github.com/sassoftware/SASVI/blob/main/examples/README.md) cover documents, insights, workspaces, alerts,
search, workflows, bulk work, administration and custom endpoints. The
[examples guide](https://sassoftware.github.io/SASVI/Guides/examples/) says what each one does, and the
[recipes](https://sassoftware.github.io/SASVI/Guides/recipes/) are shorter.

### Troubleshooting

The [troubleshooting guide](https://sassoftware.github.io/SASVI/Guides/troubleshooting/) maps each error to its cause and
fix. The [FAQ](https://sassoftware.github.io/SASVI/Guides/faq/) covers the questions that come up most often.

## Contributing

Maintainers are accepting patches and contributions to this project.
Please read [CONTRIBUTING.md](https://github.com/sassoftware/SASVI/blob/main/CONTRIBUTING.md) for details about submitting contributions to this project.

To report a security issue, follow the [security policy](https://github.com/sassoftware/SASVI/blob/main/SECURITY.md). For help using the project,
see [SUPPORT.md](https://github.com/sassoftware/SASVI/blob/main/SUPPORT.md).

## License

This project is licensed under the [Apache 2.0 License](https://github.com/sassoftware/SASVI/blob/main/LICENSE).

## Third-Party Dependencies

This project requires the following dependencies.

| Dependency | License |
| ---------- | ------- |
| `attrs` | [MIT](https://github.com/python-attrs/attrs/blob/main/LICENSE) |
| `httpx2` | [BSD 3-Clause](https://github.com/pydantic/httpx2/blob/main/LICENSE.md) |
| `pydantic` | [MIT](https://github.com/pydantic/pydantic/blob/main/LICENSE) |

The optional command-line interface (`pip install "sasvi[cli]"`) adds the following dependencies.

| Dependency | License |
| ---------- | ------- |
| `typer` | [MIT](https://github.com/fastapi/typer/blob/master/LICENSE) |
| `click` | [BSD 3-Clause](https://github.com/pallets/click/blob/main/LICENSE.txt) |
| `rich` | [MIT](https://github.com/Textualize/rich/blob/master/LICENSE) |

## Additional Resources

- [Documentation](https://sassoftware.github.io/SASVI/)
- [Before you start](https://sassoftware.github.io/SASVI/before-you-start/) and the [quickstart](https://sassoftware.github.io/SASVI/quickstart/)
- [How-to guides](https://sassoftware.github.io/SASVI/Guides/)
- [API reference](https://sassoftware.github.io/SASVI/api/)
- [Command-line interface](https://sassoftware.github.io/SASVI/Guides/cli/)
- [Changelog](https://github.com/sassoftware/SASVI/blob/main/CHANGELOG.md)
- [SAS Visual Investigator REST APIs](https://developer.sas.com)
