Library API

Files

FileDescription
crypto.qCryptographic digests (SHA-2, SHA-3, BLAKE2, MD5, SHA-1, MD4), HMAC and random bytes from the platform's OpenSSL.
csv.qRead delimited text (CSV, TSV) as a table, from a file, a URL or text in memory.
duckdb.qQuery and write DuckDB databases from q: a database is a handle, its tables are q tables.
ffi.qCall C from q: .ffi.bind turns a symbol in any shared library into a q function, .ffi.callFunction is the one-shot form.
fs.qThe filesystem: .fs.exists, .fs.isfile, .fs.isdir, .fs.size answer for a path, a symbol or a list of them; .fs.remove deletes the files named and .fs.rmdir the empty directories named - never anything below them; .fs.rmtree deletes a directory tree.
hash.qNon-cryptographic hashes - xxHash (xxh32, xxh64, xxh3_64, xxh3_128), rapidhash and MurmurHash3 - for bucketing, keying, sampling and fingerprinting (md5 and .Q.sha1 are the digests).
j.qRead JSON as a table: .j.read loads a document or JSON Lines from a file, a URL or a string, .j.info shows the schema it would use.
kafka.qKafka from q: a client is a handle, a subscription delivers ONE table per batch to a target, a topic is a table coordinate, and the same handle publishes bytes or rows.
massive.qMarket data from the Massive REST API (massive.com) as q tables: bars, daily aggregates, snapshots, trades, quotes, tickers, splits, dividends, IPOs and news.
md.qRead Markdown as q data: .md.parse answers one row per block, .md.html renders XHTML.
parquet.qRead and write parquet files through DuckDB: .parquet.read answers a table, .parquet.write writes one, and the schema, metadata, file_metadata, kv_metadata and bloom_probe verbs answer DuckDB's own inspection tables.
path.qPath structure as text, pathlib's names: .path.name, .path.stem, .path.suffix, .path.parent, .path.join and .path.string.
pkg.qpkg.q - package loading: .pkg.loadq[`:dirlist] loads every .q file under the directories, then runs each namespace's init* The only public function intended to be called is .pkg.loadq[`:dirlist].
pq.qThe session itself: version, open connections, terminal size and colour support, and the standard-library load sequence.
qunit.qqunit.q - unit testing for q similar to junit, cunit etc.
regexp.qRegular expressions in RE2 syntax: match, extract, capture groups, replace, split and escape.
s.qSQL on the process's own DuckDB database: s)SELECT ...
sql.qA SQL SELECT as a q tree, slot for slot the shape q's own select (?) takes: (`sql;source;where;by;columns;limit;order).
str.qPython's string helpers with Python's spellings and semantics: strip lstrip rstrip, startswith endswith, removeprefix removesuffix, isalpha isdigit isalnum isspace isupper islower, printf and format.
termbox.qDraw on the terminal as a grid of cells: .termbox.init[] takes the screen, .termbox.show rows paints a list of strings from the top-left corner, .termbox.present[] flushes the changes, .termbox.peek_event 100 waits up to 100 ms for a key or mouse event, .termbox.shutdown[] hands the terminal back.
yml.qYAML: .yml.load reads YAML lines or a file into q values, .yml.dump writes a q value out as YAML lines.