# Features:

`qsv` has several features:

* `jemallocator` (default) - use the jemalloc allocator (see [Memory Allocator](./PERFORMANCE.md#memory-allocator) for more info).
* `mimalloc` - use the mimalloc allocator (see [Memory Allocator](./PERFORMANCE.md#memory-allocator) for more info).
* `apply` - enable `apply` command. This swiss-army knife of CSV transformations is very powerful, but it has a lot of dependencies that increases both compile time and binary size.
* `fetch` - enables the `fetch` & `fetchpost` commands.
* `get` - enable `get` command. Gets tabular data from various sources into a content-addressed disk cache, with `dc:` cache references usable as input to other commands.
* `get_cloud` - extends `get` with cloud object-store sources (`s3://`, `gs://`, `az://`).
* `foreach` - enable `foreach` command.
* `geocode` - enable `geocode` & `geoconvert` commands.
* `clipboard` - enable `clipboard` command.
* `color` - enable `color` command. Enables colorized tabular output. When the `polars` feature is also enabled, supports multiple non-CSV formats.
* `lens` - enable `lens` command.
* `luau` - enable `luau` command. Embeds a [Luau](https://luau-lang.org) interpreter into qsv. [Luau has type-checking, sandboxing, additional language operators, increased performance & other improvements](https://luau-lang.org/2022/11/04/luau-origins-and-evolution.html) over Lua. Luau is the DSL of qsv - as its statically linked, has a MUCH smaller footprint (in both file size and memory without having to deal with Python's infamous [Global Interpreter Lock](https://wiki.python.org/moin/GlobalInterpreterLock)) & is faster (in both startup & execution time) than Python.
* `polars` - enables all [Polars](https://pola.rs)-powered commands (currently, `joinp`, `pivotp`, `scoresql` and `sqlp` and enables polars mode in `count`). It also enables support for reading `.parquet`, `.ipc`/`.arrow` and `.json`/`.jsonl` formats as well as `.csv.gz`, `.csv.zst` and `.csv.zlib` compressed files.<br />Note that Polars is a very powerful library, but it has a lot of dependencies that drastically increases both compile time and binary size.
* `prompt` - enable `prompt` command.
* `python` - enable `py` command. Note that qsv will look for the shared library for the Python version (Python 3.11 & above supported) it was compiled against & will abort on startup if the library is not found, even if you're NOT using the `py` command. Check [Python](./INTERPRETERS.md#building-qsv-with-python-feature) section for more info. Though Luau is the preferred DSL for qsv for all the reasons stated above, Python is still the lingua franca of data wrangling.
* `synthesize` - enable `synthesize` command. Generates statistically-faithful synthetic CSVs from a source CSV using `stats` + `frequency` plus, optionally, semantic Content Types from a Data Dictionary to pick realistic [fake-rs](https://github.com/cksac/fake-rs) fakers.
* `viz` - enable `viz` command. Generates interactive [Plotly](https://plotly.com/javascript/) charts (bar, line, scatter, scatter3d, histogram, box, violin, pie, heatmap, contour, candlestick, ohlc, sankey, radar, treemap, sunburst, icicle, splom, parcats, map, geo, choropleth, funnel, and a `smart` auto-dashboard that produces a Data Schematic) as self-contained, browser-openable HTML (set `QSV_VIZ_CDN` to load plotly.js from a CDN instead, for much smaller, online-only pages).
* `viz_static` - extends `viz` with static image export (PNG/SVG/PDF/JPEG/WebP) via [plotly_static](https://crates.io/crates/plotly_static). Requires a headless browser (Chrome or Firefox) and a webdriver at runtime (webdriver is auto-downloaded).
* `profile` - enable `profile` command. Extracts and infers DCAT-3/Croissant metadata from a CSV using a scheming spec.
* `geoconnex` - extends `profile` with the `geoconnex` profile for hydrologic/water-data federations (JSON-LD output).
* `magika` - enable [Magika](https://github.com/google/magika)-powered, AI-based file type detection in the `sniff` command for enhanced MIME type identification. Falls back to the `file-format` crate in `qsvlite`/`qsvdp` variants. Not available on MUSL builds.
* `mcp` - enable `log` command and MCP (Model Context Protocol) skill JSON generation for AI agent integration.
* `to` - enables the `to` command.
* `self_update` - enable self-update engine, checking GitHub for the latest release. Note that if you manually built qsv, self-update will only alert you about new releases (when qsv is invoked with no command, it checks GitHub for the latest release at most twice a month — throttled by a persisted stamp file with a 15-day interval — unless the `QSV_NO_UPDATE` environment variable is set). It will NOT offer the choice to update itself to the prebuilt binaries published on GitHub.  
You need not worry that your manually built qsv will be overwritten by a self-update.  
To check if your qsv build will have the option to self-update, run `qsv --version`. If you see `self_update` in the enabled features, and QSV_KIND is `prebuilt*` at the end, then you have the option to self-update.
* `ui` - enables commands that require linking UI libraries - `clipboard`, `color`, `lens` and `prompt`. Disable this feature if you're building for a headless environment. Note that `qsvdp` and `qsvlite` does not enable the `ui` feature by default.

## Special Features for building qsv binary variants:

* `feature_capable` - enable to build `qsv` binary variant which is feature-capable. Also used by `qsvmcp`. (mutually exclusive with `lite` and `datapusher_plus`)
  * `all_features` - shortcut to build `qsv` binary variant with all features enabled (apply,fetch,foreach,geocode,geoconnex,get,get_cloud,luau,magika,mcp,polars,profile,synthesize,to,viz_static,self_update,ui).

* `qsvmcp` - enable to build `qsvmcp` binary variant - optimized for [MCP](https://modelcontextprotocol.io/) server use with geocode, get, get_cloud, mcp, polars, profile, self_update, synthesize, to, and viz features. Shares `src/main.rs` with `qsv`. (mutually exclusive with `lite` and `datapusher_plus`). Uses `viz` rather than `viz_static` because viz over MCP is HTML-only by design - the MCP server rejects a non-HTML `--output` before qsv runs, so the browser/webdriver-backed static-export path was never reachable there.
* `lite` - enable to build `qsvlite` binary variant with all features disabled. (mutually exclusive with `feature_capable` and `datapusher_plus`)
* `datapusher_plus` - enable to build `qsvdp` binary variant - the [DataPusher+](https://github.com/dathere/datapusher-plus) optimized qsv binary. Pulls in `geocode`, `get`, `get_cloud`, `polars`, `profile`, and `self_update`. (mutually exclusive with `feature_capable` and `lite`)
* `nightly` - enable to turn on nightly-only features when building with Rust nightly/unstable. Specifically: `crc32fast/nightly`, `pyo3/nightly`, `rand/simd_support`, `simd-json/hints` and `foldhash/nightly`. Note that Polars has its own separate `nightly-polars` feature.
* `distrib_features` - enable to build `qsv` binary variant with the core distribution features enabled (apply, fetch, foreach, geocode, geoconnex, get, get_cloud, luau, mcp, polars, profile, synthesize, to, viz_static) - i.e. all features except `self_update`, `ui`, `magika`, and `python`. This should make it easier for distro packagers to build `qsv` as qsv removes and adds features over time.

> [!NOTE]
> `qsvlite`, as the name implies, always has **non-default features disabled**. `qsv` can be built with any combination of the above features using the cargo `--features` & `--no-default-features` flags. The prebuilt `qsv` binaries have **all applicable features valid for the target platform**.
