Skip to main content
Each recipe is a complete Python example that solves one task with the Validio SDK. Every recipe has the same three parts:
  • Overview: What the recipe does, and when it’s useful.
  • Steps: A walkthrough of the code, one part at a time.
  • Full code sample: The complete script, ready to copy. Where it helps, an example response follows.
To install the SDK and set up your credentials first, see Getting started. The recipes create the client without arguments, so it finds your credentials automatically. See How the CLI and SDK find credentials. Where a recipe reads an ID from an environment variable, such as EXAMPLE_SOURCE_ID, set it or substitute your own value.
The client is asynchronous, so the example functions are async. To call one from synchronous code, wrap it in asyncio.run. See Synchronous or asynchronous.

Recipes

Create a credential and source

Create a credential, infer a schema, and create a source.

Delete a credential

Delete a credential with a mutation and variables.

Export incident groups to CSV

Page through a source’s incident groups and export their incidents.

Export metrics to CSV

Export a validator segment’s metrics to CSV, one day at a time.

Get incidents for a validator

Query a validator’s incidents by its resource name.

Get info for a validator

Fetch a validator’s details and related resources with fragments.

List credentials

List all credentials with their name and type, using an alias.

Manually poll a source and its validators

Poll a source and stop a pipeline when new incidents appear.

Number of incidents by severity

Count a source’s incidents by severity over the past week.

Set up a channel and notification rule

Create a Slack channel and a rule that sends alerts on it.

Update a source schema

Re-infer, verify, and update a source’s schema.

Update a validator

Update a validator’s name and dynamic threshold in one mutation.

Using the SDK with IaC

Reuse an existing validator’s threshold in Validio Code.