Libraries

Scriptling provides 90+ libraries organized by capability. Availability depends on the binary, execution mode, and host registration; it is not safe to assume every library is present.

Know the import name? Jump to the A–Z list of every library.

Python-Style Libraries

Modules that mirror Python’s standard library, grouped by subject:

The standard set (json, re, time, datetime, math, random, statistics, base64, hashlib, hmac, uuid, string, html, textwrap, difflib, io, platform, urllib.parse, collections, itertools, functools, contextlib, msgpack) has no access to the host and is registered together by stdlib.RegisterAll. The rest are extended libraries, registered one by one because they reach the file system, network, processes or host: see Availability.

Scriptling Libraries

The scriptling.* libraries provide functionality beyond Python’s standard library:

  • AI: LLM clients, agents, memory, tool schemas
  • Databases: SQLite, SQL, Valkey, BadgerDB, and the ORM
  • MCP: MCP clients and tool authoring
  • Messaging: Telegram, Discord, Slack, console
  • Networking: Gossip, multicast, unicast, DNS, WebSocket
  • Packages: Read files and metadata from loaded app/plugin bundles
  • Plugins: Control library for executable plugins
  • Provisioning: File and fetch provisioning
  • Runtime: Background tasks, HTTP, JSON-RPC, MCP, KV, sync, sandbox
  • Templates: Go-powered HTML and text templates
  • Utilities: Console, containers, Nomad, grep, find, CSV, XML, secrets, and more

All Libraries A–Z

Every library by the name you import it as. Use the cheat sheet for quick examples of the common ones.

ImportDescriptionCategory
base64 Base64 encoding and decoding. Math & Numbers
bytes Binary data type and constructor. Data Formats
collections Specialized container datatypes, counters, double-ended queues, named tuples, and chained dicts. Collections & Iteration
contextlib Utilities for common tasks involving the with statement. Collections & Iteration
datetime Date and time objects with construction, formatting, arithmetic, and comparison, using a Python-compatible API. Time & System
difflib Compute deltas between sequences, including unified diffs, similarity ratios, and close-match finding. Text Processing
fs Binary I/O for reading, writing, and unpacking binary file formats. File System
functools Higher-order functions that act on or return other functions. Collections & Iteration
glob Unix shell-style wildcard matching for filenames, similar to Python's glob module. File System
hashlib Cryptographic hash functions. Math & Numbers
hmac Keyed-hashing for message authentication (HMAC). Math & Numbers
html Escape and unescape HTML special characters and entities. Text Processing
html.parser An HTML/XHTML parser compatible with Python's html.parser module. Text Processing
io In-memory text I/O streams, providing StringIO as a buffer that behaves like a text file. Text Processing
itertools Iteration utilities for efficient looping, filtering, and combinatorics. Collections & Iteration
json Parse and generate JSON data. Data Formats
logging Python-style logging, backed by structured slog-based loggers. Time & System
math Mathematical functions and constants. Math & Numbers
msgpack Parse and generate MessagePack binary data. Data Formats
os Operating system interfaces for file system operations and environment variables. File System
os.path Common pathname manipulations, similar to Python's os.path module. File System
pathlib Object-oriented filesystem paths, similar to Python's pathlib module. File System
platform Read-only access to the underlying operating system, architecture, and hostname information. Time & System
random Random number generation, compatible with Python's random module. Math & Numbers
re Regular expression matching and text processing, following Python's re module conventions. Text Processing
requests HTTP client for making GET, POST, PUT, DELETE, and PATCH requests. HTTP & Process
scriptling.ai AI and LLM functions for OpenAI-compatible APIs: clients, completions, embeddings, and tool-calling helpers. AI
scriptling.ai.agent Agentic AI loop for building AI agents with automatic tool execution. AI
scriptling.ai.agent.interact Interactive terminal interface for conversing with AI agents via a REPL-style loop. AI
scriptling.ai.Client Primary client interface for calling AI providers like OpenAI, Claude, Gemini and Grok. AI
scriptling.ai.memory Long-term, deduplicated memory store for AI agents backed by a KV store. AI
scriptling.ai.tools Tool schema builder for AI agents. AI
scriptling.badgerdb BadgerDB embedded key/value store with the valkey API on local storage. Databases
scriptling.console TUI (terminal UI) console for building interactive chat-style applications. Utilities
scriptling.container Container lifecycle management for Docker, Podman, and Apple Containers through a unified interface. Utilities
scriptling.csv CSV parsing and formatting (string-based, no filesystem access). Utilities
scriptling.find Find files and directories by name, type, modification time, and size. Utilities
scriptling.grep Fast file content search using regular expressions or literal strings. Utilities
scriptling.markdown Convert Markdown to HTML using the GitHub Flavored Markdown specification. Utilities
scriptling.mcp MCP client library for connecting to MCP servers and invoking the tools they expose. MCP Protocol
scriptling.mcp.tool MCP tool helper for authoring MCP tools, with parameter access and result handling. MCP Protocol
scriptling.messaging.console Console-based messaging client for building and testing interactive terminal bots. Messaging
scriptling.messaging.discord Discord Bot API client using a WebSocket Gateway connection for real-time events. Messaging
scriptling.messaging.slack Slack Bot API client using Socket Mode for real-time events. Messaging
scriptling.messaging.telegram Telegram Bot API client for building bots on the Telegram platform. Messaging
scriptling.net.gossip Gossip protocol cluster membership and messaging with failure detection and routing. Networking
scriptling.net.multicast UDP multicast group messaging for one-to-many communication on local networks. Networking
scriptling.net.resolve DNS resolution for hostname lookup, SRV records, and srv+http(s):// URLs. Networking
scriptling.net.unicast UDP and TCP point-to-point messaging for direct host-to-host communication. Networking
scriptling.net.websocket WebSocket client for sending and receiving text or binary messages. Networking
scriptling.nomad HashiCorp Nomad client covering CSI volumes, dynamic host volumes, and jobs. Utilities
scriptling.oauth OAuth 2.0 and OpenID Connect - device sign-in, client credentials, refresh tokens and access token verification. HTTP & Process
scriptling.package Read metadata and files from app and plugin bundles loaded by the host.
scriptling.plugin Control library for listing, inspecting, calling, and loading executable plugins at runtime.
scriptling.provision.fetch Download files over HTTP/HTTPS and optionally unpack zip archives, idempotently. Provisioning
scriptling.provision.file Create, update, and remove files and directories idempotently, including marker-delimited managed blocks. Provisioning
scriptling.runtime Background tasks and concurrency, plus the runtime namespace grouping HTTP, JSON-RPC, KV, MCP, sync, sandbox, and plugin sub-libraries. Runtime
scriptling.runtime.http Register HTTP routes, middleware, and response helpers for a Scriptling-backed server. Runtime
scriptling.runtime.jsonrpc Register JSON-RPC 2.0 server methods and notifications served over stdio or HTTP. Runtime
scriptling.runtime.kv Thread-safe key-value store for sharing state across requests and background tasks. Runtime
scriptling.runtime.mcp Register MCP tools, resources, prompts and skills via decorators — metadata and implementation in a single file. Runtime
scriptling.runtime.plugin Declare a Scriptling script as a first-class plugin server exposing functions, constants, and classes to remote clients. Runtime
scriptling.runtime.sandbox Create isolated Scriptling execution environments for running script code with its own variable scope. Runtime
scriptling.runtime.sync Named cross-environment concurrency primitives, atomics, shared variables, wait groups, and queues. Runtime
scriptling.secret Resolve secrets through host-configured provider aliases without exposing provider credentials to scripts. Utilities
scriptling.sed In-place file content replacement and capture group extraction. Utilities
scriptling.similarity Text similarity utilities for fuzzy matching, tokenization, MinHash signatures, and extractive text shortening. Utilities
scriptling.sql MySQL, MariaDB and PostgreSQL client with one connect() per DSN scheme and one shared API. Databases
scriptling.sqlite SQLite embedded relational database, connect, query, execute, close. Databases
scriptling.template Go-powered text and HTML template rendering with automatic escaping.
scriptling.template.html HTML template rendering using Go's html/template, with automatic escaping. Templates
scriptling.template.text Text template rendering using Go's text/template, with no escaping. Templates
scriptling.toon TOON (Token-Oriented Object Notation) encoding and decoding, a compact, human-readable alternative to JSON. Utilities
scriptling.valkey Valkey and Redis key/value client with strings, counters, TTLs, sets, queues and key patterns. Databases
scriptling.wait_for Wait for files, directories, ports, HTTP endpoints, or processes to become available. Utilities
scriptling.xml XML parsing and formatting (dict-based, string-only). Utilities
secrets Cryptographically strong random number generation for tokens, keys, and passwords. Math & Numbers
shlex Shell-style lexical analysis — quoting, splitting, and joining command-line tokens. Text Processing
shutil High-level file and directory operations — copy, move, rmtree, disk_usage. File System
statistics Functions for calculating mathematical statistics of numeric data. Math & Numbers
string String constants for character classification, matching Python's string module. Text Processing
subprocess Spawn and manage subprocesses, similar to Python's subprocess module. HTTP & Process
sys System-specific parameters and functions, similar to Python's sys module. Time & System
tarfile Read and write TAR archives (uncompressed and gzipped). File System
tempfile Temporary file and directory creation with security restrictions. File System
textwrap Text wrapping and filling utilities, compatible with Python's textwrap module. Text Processing
time Time access and conversions, including timestamps, time tuples, formatting, and sleeping. Time & System
toml Parse and generate TOML (Tom's Obvious Minimal Language) data. Data Formats
urllib.parse Parse, split, join, and percent-encode/decode URLs and query strings without network access. HTTP & Process
uuid UUID generation, matching Python's uuid module. Math & Numbers
yaml Parse and generate YAML (YAML Ain't Markup Language) data. Data Formats
zipfile Read and write ZIP archives. File System

Availability

A bare scriptling.New() environment has no libraries; embedders register every capability they intend to expose. The default CLI setup composes a broader set, subject to execution mode and disable flags.

Library group Default CLI and server setup Bare embedding
Standard libraries Registered together stdlib.RegisterAll(p)
Core extended and scriptling.* libraries Registered unless disabled; the exact set varies by mode Register each required library explicitly
scriptling.ai.tools The standalone namespace is not registered by normal setup; use scriptling.ai.ToolRegistry when scriptling.ai is present Register the standalone tools library explicitly if needed
scriptling.ai.agent.interact Added on the ordinary non-server CLI execution path; evaluator factories and server modes omit it Register it explicitly together with its console dependency
Database libraries Compiled into the default scriptling build, matching custom build tags, or discovered external database plugins Register compiled plugins or load external plugins; see Database availability
scriptling.package Present only when a non-nil app/plugin bundle loader is available, including ordinary CLI or server execution Register it with a non-nil package loader
scriptling.runtime.mcp Included wherever CLI setup registers the runtime aggregate, in ordinary CLI and server modes, unless disabled RegisterRuntimeLibraryAll(...) includes it; RegisterRuntimeMCPLibrary(p) registers only this sub-library

There is no universal extended-library RegisterAll. stdlib.RegisterAll covers only the standard libraries; CLI composition and plugin discovery are separate from the embedding API. See Library Registration for individual calls.

Security and Capability Boundaries

Registration grants scripts the host process’s authority for that surface. In particular:

  • filesystem, subprocess, environment, secret, and provisioning libraries can read, write, execute, or disclose host data according to their configured restrictions;
  • the outbound libraries (requests, scriptling.oauth, wait_for, WebSocket, unicast, multicast, gossip, Nomad, AI, MCP, provision.fetch, the Slack, Discord and Telegram libraries, and container endpoints a script supplies) obey an embedding netsecurity.Config or the CLI network-policy file when one is passed at registration, but HTTP clients the embedding application builds itself and plugin processes are separate surfaces and do not inherit it;
  • container and Nomad libraries can control available local runtimes or remote cluster workloads;
  • runtime HTTP/JSON-RPC/MCP/plugin servers and messaging handlers create remotely reachable entry points; authentication and authorization remain the application’s responsibility;
  • plugin loading and package bundles add host-selected code and content, while provisioning can change files or fetch remote content.

Register only what a script needs, apply each library’s own controls, and use OS/container egress and process isolation where a library has no matching in-process policy. See the Security Guide and each library’s security section for details.

Getting Help

Use the help() function within scripts:

import json
help(json)