convert¶
Convert a file from one format to another. Same surface as the CLI's
octa --convert: both ends resolved by
file extension, both routed through Octa's FormatRegistry.
When to use¶
- "Convert this Excel to a clean Parquet."
- "Export this SQLite table to CSV."
- "Make a JSON copy of this Stata file."
Input schema¶
| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
input |
string | yes | (no default) | Source file path. Format inferred from extension |
output |
string | yes | (no default) | Destination file path. Format inferred from extension |
table |
string | no | (no default) | For multi-table input sources, which table to export |
unlimited |
bool | no | false |
Lift the 5,000,000-row file-loader cap so the entire source file is converted |
Response shape¶
Example calls¶
CSV → Parquet¶
Response:
Export one SQLite table to JSON¶
{
"name": "convert",
"arguments": {
"input": "/data/app.sqlite",
"output": "/tmp/users.json",
"table": "users"
}
}
Excel → SQLite¶
{
"name": "convert",
"arguments": {
"input": "/tmp/quarterly.xlsx",
"output": "/tmp/quarterly.sqlite"
}
}
Read-only target rejection¶
Octa rejects up-front when the output extension maps to a read-only reader:
| Format | Why read-only |
|---|---|
SAS (.sas7bdat) |
sas7bdat 0.2 is read-only |
R datasets (.rds, .rdata, .rda) |
rds2rust is read-only |
HDF5 (.h5, .hdf5, .hdf) |
hdf5-reader is read-only |
NetCDF (.nc) |
netcdf3 is read-only |
EPUB (.epub) |
Read-only by design |
GeoJSON (.geojson) |
Read-only by design |
Trying to convert to one of these errors with:
{ "error": { "code": "invalid_params", "message": "convert failed: format SAS does not support writing; pick a different output extension" }}
These same formats are perfectly fine as input: convert
input.sas7bdat output.csv is valid.
Performance and safety¶
- The input is loaded fully into memory before writing. Streaming
formats (Parquet, CSV, TSV) honour the initial-load cap during
the read step (5,000,000 rows by default). For larger
conversions, pass
unlimited: true. Parquet files with very many row groups fall back to a DuckDB-backed reader automatically. convertoverwrites the output path without prompting, so make sure the destination is what you intend.
Notes¶
- Excel writes always produce
.xlsxstructure regardless of the chosen Excel extension, sincerust_xlsxwritercan't emit legacy.xls/.xlsm/.xlsb. Save those as.xlsx..odshas its own dedicated reader+writer so it round-trips natively. - Database outputs (SQLite, DuckDB, GeoPackage) write a single
table named after the input's stem. Both
run_sql(here) andocta --sqluse ephemeral DuckDB sessions, so neither persistsCREATE TABLE/INSERTto disk; useconvertitself, or open the target database in the GUI to edit table names directly.
See also¶
octa --convertis the CLI equivalent.- Supported formats is the full read/write matrix.