2026-01-26 04:12:14 +00:00
{# retoor < retoor @ molodetz . nl > #}
{% extends 'page.html' %}
2026-01-24 22:40:22 +00:00
2026-01-26 04:12:14 +00:00
{% set page_title = "API Reference" %}
{% set breadcrumb = [{"title": "API Reference"}] %}
{% set prev_page = {"url": "language/modules.html", "title": "Modules"} %}
{% set next_page = {"url": "api/http.html", "title": "http"} %}
{% block article %}
2026-01-24 22:40:22 +00:00
< h1 > API Reference</ h1 >
2026-01-25 12:09:28 +00:00
< p > Wren-CLI provides 32 built-in modules covering networking, file I/O, data processing, system operations, and more. All modules are imported using the < code > import</ code > statement.</ p >
2026-01-24 22:40:22 +00:00
< pre >< code > import "http" for Http
import "json" for Json
import "io" for File</ code ></ pre >
2026-01-25 03:58:39 +00:00
< h2 > Core Types</ h2 >
< p > Extended methods on built-in types, available without imports.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "string.html" > String</ a ></ h3 >
< p > Case conversion, character testing, padding, splitting, reversing, and more on all strings.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "number.html" > Num</ a ></ h3 >
< p > Query predicates, hyperbolic functions, base conversion, formatting, GCD/LCM, and more on all numbers.</ p >
</ div >
</ div >
2026-01-24 22:40:22 +00:00
< h2 > Networking</ h2 >
< p > Modules for HTTP, WebSocket, and low-level network operations.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "http.html" > http</ a ></ h3 >
< p > HTTP client for making GET, POST, PUT, DELETE, and PATCH requests. Supports HTTPS.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "websocket.html" > websocket</ a ></ h3 >
< p > WebSocket client and server implementation with full protocol support.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "tls.html" > tls</ a ></ h3 >
< p > TLS/SSL socket wrapper for encrypted connections using OpenSSL.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "net.html" > net</ a ></ h3 >
< p > Low-level TCP sockets and servers for custom network protocols.</ p >
</ div >
2026-01-25 12:09:28 +00:00
< div class = "card" >
< h3 >< a href = "udp.html" > udp</ a ></ h3 >
< p > UDP datagram sockets for connectionless networking.</ p >
</ div >
2026-01-24 22:40:22 +00:00
< div class = "card" >
< h3 >< a href = "dns.html" > dns</ a ></ h3 >
< p > DNS resolution for hostname to IP address lookups.</ p >
</ div >
</ div >
< h2 > Data Processing</ h2 >
< p > Modules for parsing, encoding, and transforming data.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "json.html" > json</ a ></ h3 >
< p > Parse and stringify JSON data with pretty-printing support.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "base64.html" > base64</ a ></ h3 >
< p > Base64 encoding and decoding for binary-to-text conversion.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "regex.html" > regex</ a ></ h3 >
< p > Regular expression matching, replacement, and splitting.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "jinja.html" > jinja</ a ></ h3 >
< p > Jinja2-compatible template engine with filters, inheritance, and macros.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "crypto.html" > crypto</ a ></ h3 >
< p > Cryptographic hashing (MD5, SHA-1, SHA-256) and random byte generation.</ p >
</ div >
2026-01-25 01:47:47 +00:00
< div class = "card" >
< h3 >< a href = "uuid.html" > uuid</ a ></ h3 >
< p > UUID generation and validation with v4 support.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "html.html" > html</ a ></ h3 >
< p > HTML/URL encoding, decoding, slug generation, and query string handling.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "markdown.html" > markdown</ a ></ h3 >
< p > Convert Markdown text to HTML with safe mode support.</ p >
</ div >
2026-01-24 22:40:22 +00:00
</ div >
< h2 > System</ h2 >
< p > Modules for interacting with the operating system and environment.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "os.html" > os</ a ></ h3 >
< p > Platform information, process details, and command-line arguments.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "env.html" > env</ a ></ h3 >
< p > Read and write environment variables.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "signal.html" > signal</ a ></ h3 >
< p > Handle Unix signals like SIGINT, SIGTERM, and SIGHUP.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "subprocess.html" > subprocess</ a ></ h3 >
< p > Run external commands and capture their output.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "io.html" > io</ a ></ h3 >
< p > File and directory operations, stdin/stdout handling.</ p >
</ div >
2026-01-25 03:58:39 +00:00
< div class = "card" >
< h3 >< a href = "pathlib.html" > pathlib</ a ></ h3 >
< p > Object-oriented filesystem paths with glob, walk, and tree operations.</ p >
</ div >
2026-01-25 12:09:28 +00:00
< div class = "card" >
< h3 >< a href = "sysinfo.html" > sysinfo</ a ></ h3 >
< p > System information: CPU, memory, uptime, and network interfaces.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "fswatch.html" > fswatch</ a ></ h3 >
< p > File system watching for monitoring file and directory changes.</ p >
</ div >
2026-01-24 22:40:22 +00:00
</ div >
< h2 > Data & Time</ h2 >
< p > Modules for databases, time, and scheduling.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "sqlite.html" > sqlite</ a ></ h3 >
< p > SQLite database for persistent data storage with SQL queries.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "datetime.html" > datetime</ a ></ h3 >
< p > Date and time manipulation with formatting and arithmetic.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "timer.html" > timer</ a ></ h3 >
< p > Sleep, timeouts, and interval timers.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "math.html" > math</ a ></ h3 >
< p > Mathematical functions like sqrt, sin, cos, and constants like PI.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "scheduler.html" > scheduler</ a ></ h3 >
< p > Async fiber scheduling for non-blocking I/O operations.</ p >
</ div >
2026-01-25 01:47:47 +00:00
< div class = "card" >
< h3 >< a href = "dataset.html" > dataset</ a ></ h3 >
< p > Simple ORM for SQLite with automatic schema management.</ p >
</ div >
</ div >
< h2 > Application Development</ h2 >
< p > Modules for building web applications and command-line tools.</ p >
< div class = "card-grid" >
< div class = "card" >
< h3 >< a href = "web.html" > web</ a ></ h3 >
< p > Web framework with routing, middleware, sessions, and HTTP client.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "argparse.html" > argparse</ a ></ h3 >
< p > Command-line argument parsing with type conversion and help generation.</ p >
</ div >
< div class = "card" >
< h3 >< a href = "wdantic.html" > wdantic</ a ></ h3 >
< p > Data validation with schema definitions and built-in validators.</ p >
</ div >
2026-01-24 22:40:22 +00:00
</ div >
< h2 > Module Summary</ h2 >
< table >
< tr >
< th > Module</ th >
< th > Main Classes</ th >
< th > Description</ th >
</ tr >
< tr >
< td >< a href = "http.html" > http</ a ></ td >
< td > Http, HttpResponse, Url</ td >
< td > HTTP/HTTPS client</ td >
</ tr >
< tr >
< td >< a href = "websocket.html" > websocket</ a ></ td >
< td > WebSocket, WebSocketServer, WebSocketMessage</ td >
< td > WebSocket protocol</ td >
</ tr >
< tr >
< td >< a href = "tls.html" > tls</ a ></ td >
< td > TlsSocket</ td >
< td > TLS/SSL sockets</ td >
</ tr >
< tr >
< td >< a href = "net.html" > net</ a ></ td >
< td > Socket, Server</ td >
< td > TCP networking</ td >
</ tr >
2026-01-25 12:09:28 +00:00
< tr >
< td >< a href = "udp.html" > udp</ a ></ td >
< td > UdpSocket, UdpMessage</ td >
< td > UDP networking</ td >
</ tr >
2026-01-24 22:40:22 +00:00
< tr >
< td >< a href = "dns.html" > dns</ a ></ td >
< td > Dns</ td >
< td > DNS resolution</ td >
</ tr >
< tr >
< td >< a href = "json.html" > json</ a ></ td >
< td > Json</ td >
< td > JSON parsing</ td >
</ tr >
< tr >
< td >< a href = "base64.html" > base64</ a ></ td >
< td > Base64</ td >
< td > Base64 encoding</ td >
</ tr >
< tr >
< td >< a href = "regex.html" > regex</ a ></ td >
< td > Regex, Match</ td >
< td > Regular expressions</ td >
</ tr >
< tr >
< td >< a href = "jinja.html" > jinja</ a ></ td >
< td > Environment, Template, DictLoader, FileSystemLoader</ td >
< td > Template engine</ td >
</ tr >
< tr >
< td >< a href = "crypto.html" > crypto</ a ></ td >
< td > Crypto, Hash</ td >
< td > Cryptography</ td >
</ tr >
< tr >
< td >< a href = "os.html" > os</ a ></ td >
< td > Process, Platform</ td >
< td > OS information</ td >
</ tr >
< tr >
< td >< a href = "env.html" > env</ a ></ td >
< td > Env</ td >
< td > Environment variables</ td >
</ tr >
2026-01-25 12:09:28 +00:00
< tr >
< td >< a href = "fswatch.html" > fswatch</ a ></ td >
< td > FileWatcher, FsEvent</ td >
< td > File system watching</ td >
</ tr >
2026-01-24 22:40:22 +00:00
< tr >
< td >< a href = "signal.html" > signal</ a ></ td >
< td > Signal</ td >
< td > Unix signals</ td >
</ tr >
< tr >
< td >< a href = "subprocess.html" > subprocess</ a ></ td >
< td > Subprocess</ td >
< td > External processes</ td >
</ tr >
2026-01-25 12:09:28 +00:00
< tr >
< td >< a href = "sysinfo.html" > sysinfo</ a ></ td >
< td > SysInfo</ td >
< td > System information</ td >
</ tr >
2026-01-24 22:40:22 +00:00
< tr >
< td >< a href = "sqlite.html" > sqlite</ a ></ td >
< td > Sqlite</ td >
< td > SQLite database</ td >
</ tr >
< tr >
< td >< a href = "datetime.html" > datetime</ a ></ td >
< td > DateTime, Duration</ td >
< td > Date/time handling</ td >
</ tr >
< tr >
< td >< a href = "timer.html" > timer</ a ></ td >
2026-01-25 12:09:28 +00:00
< td > Timer, TimerHandle</ td >
< td > Timers, delays, and intervals</ td >
2026-01-24 22:40:22 +00:00
</ tr >
< tr >
< td >< a href = "io.html" > io</ a ></ td >
< td > File, Directory, Stdin, Stdout</ td >
< td > File I/O</ td >
</ tr >
2026-01-25 03:58:39 +00:00
< tr >
< td >< a href = "pathlib.html" > pathlib</ a ></ td >
< td > Path, PurePath</ td >
< td > Filesystem paths</ td >
</ tr >
2026-01-24 22:40:22 +00:00
< tr >
< td >< a href = "scheduler.html" > scheduler</ a ></ td >
< td > Scheduler</ td >
< td > Async scheduling</ td >
</ tr >
< tr >
< td >< a href = "math.html" > math</ a ></ td >
< td > Math</ td >
< td > Math functions</ td >
</ tr >
2026-01-25 01:47:47 +00:00
< tr >
< td >< a href = "uuid.html" > uuid</ a ></ td >
< td > Uuid</ td >
< td > UUID generation</ td >
</ tr >
< tr >
< td >< a href = "html.html" > html</ a ></ td >
< td > Html</ td >
< td > HTML/URL encoding</ td >
</ tr >
< tr >
< td >< a href = "argparse.html" > argparse</ a ></ td >
< td > ArgumentParser</ td >
< td > CLI arguments</ td >
</ tr >
< tr >
< td >< a href = "wdantic.html" > wdantic</ a ></ td >
< td > Validator, Field, Schema, ValidationResult</ td >
< td > Data validation</ td >
</ tr >
< tr >
< td >< a href = "dataset.html" > dataset</ a ></ td >
< td > Dataset, Table</ td >
< td > Simple ORM</ td >
</ tr >
< tr >
< td >< a href = "markdown.html" > markdown</ a ></ td >
< td > Markdown</ td >
< td > Markdown to HTML</ td >
</ tr >
< tr >
< td >< a href = "web.html" > web</ a ></ td >
< td > Application, Router, Request, Response, View, Session, Client</ td >
< td > Web framework</ td >
</ tr >
2026-01-24 22:40:22 +00:00
</ table >
2026-01-26 04:12:14 +00:00
{% endblock %}