Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.
Standard library
The standard library ships 37 canonical modules. They are not loaded by default - import them when you need them.
| Module | Import | Purpose |
|---|---|---|
| Access | import access | Capability, role, audit, and rate-limit primitives for public API authorization |
| API Context | import api_context | Typed request metadata, verified identity, capability helpers, idempotency key, request ID |
| API Response | import api_response | JSON response envelope helpers (ok_object, error_object, paging envelopes) |
| Auth | import auth | In-memory and SQLite auth services, OIDC provider configuration, signed-cookie settings |
| Bytes | import bytes | Binary data, encoding/decoding (base64, hex) |
| CLI | import cli | Command-line argument parsing |
| Collections | from collections import ... | List, dict, and set operations (map, filter, reduce, keys, values, etc.) |
| Config | import config | Deployed app config and secrets through Via's workload-identity-bound config server |
| Content | import content | Safe public content domain types (IssueTitle, MarkdownBody, SafeHtml, PublicUrl, ...) |
| Crypto | import crypto | Hashing, encryption, HMAC, signatures, encoding |
| CSV | import csv | RFC 4180 CSV parsing and writing |
| Decimal | import decimal | Arbitrary-precision decimal arithmetic |
| Environment | import env | Environment variable access |
| Filesystem | import fs | File I/O with typed paths and Result returns |
| HTTP | import http | HTTP client (GET, POST, PUT, DELETE) and static file server |
| JSON | import json | Tree API, streaming, mutable building |
| JSON Schema | import json_schema | Schema-based JSON validation |
| Logging | import log | Log level, sink, capture |
| Mapping | import mapping | Typed row-to-contract mapping helpers (map_rows, json_array_map) |
| Math | import math | Trigonometry, logarithms, rounding, constants |
| Metrics | import metrics | App-authored runtime metrics emitted through the Via runtime |
| Money | import money | Currency-safe monetary arithmetic |
| Paging | import paging | Cursor pagination helpers (PageSlice, page_slice) for handlers |
| Path | import path | Pure path manipulation utilities |
| Process | import process | Subprocess execution, argv, exit, cwd |
| Projection | import projection | Field projection policy for policy-aware JSON construction |
| Random | import random | Random integer generation |
| Scanner | import scanner | Text scanning and pattern matching |
| Service Client | import service_client | Low-level typed service client construction |
| Service Response | import service_response | Typed decoding of ServiceResponse values |
| Template | import template | Pebble-backed template rendering |
| Text | import text | String utilities (split, join, trim, pad, etc.) |
| Time | import time | Instant, Duration, Clock. Typed time API |
| URL | import url | URL parsing, building, and query encoding |
| URL Policy | import url_policy | Public outbound URL, host, DNS, and redirect policy checks |
| UUID | import uuid | UUID v4 generation, parsing, and validation |
| XML | import xml | XML/Atom builder helpers with escaping (xml_element, xml_attr) |
The api_context module also exposes verified identity fields and
helper functions for handler bindings: principal_id, subject, issuer,
session_id, api_token_id, roles, auth_kind, auth_verified,
csrf_verified, plus optional_user(ctx), authenticated_user(ctx),
has_capability(ctx, name), required_capability(ctx, name),
require_csrf(ctx), and request_capabilities(ctx).