A DuckDB extension for reading and writing FIS Prophet model point files (.rpt, .prn, .fac).
INSTALL mpduck FROM community;
LOAD mpduck;Reference a .rpt, .prn, or .fac file directly in a FROM clause:
SELECT * FROM 'model_points.rpt';
SELECT * FROM 'data/*.rpt';
SELECT * FROM 'data/*.fac';Or use read_mpfile() explicitly:
-- Single file or glob
SELECT * FROM read_mpfile('model_points.rpt');
SELECT * FROM read_mpfile('data/*.rpt');
-- Multiple files or globs
SELECT * FROM read_mpfile(['mp_2024.rpt', 'mp_2025.rpt']);
SELECT * FROM read_mpfile(['region_a*.rpt', 'region_b*.rpt']);-- The format is auto-detected from the .rpt, .prn, or .fac extension
COPY (SELECT * FROM my_table) TO 'output.rpt';
COPY (SELECT * FROM my_table) TO 'output.prn';
COPY (SELECT * FROM my_table) TO 'output.fac';
-- FORMAT mpfile can also be specified explicitly
COPY (SELECT * FROM my_table) TO 'output.rpt' (FORMAT mpfile);Use KV_METADATA to embed key-value metadata rows at the top of the file (before the schema row). The value is a struct of string key-value pairs:
COPY (SELECT * FROM my_table) TO 'output.rpt' (
KV_METADATA {run_date: '2024-01-01', version: '1.0'}
);Controls whether the VARIABLE_TYPES schema row is written. Defaults to true.
Set to false to omit the VARIABLE_TYPES row — useful when the consuming application does not expect it:
COPY (SELECT * FROM my_table) TO 'output.rpt' (INCLUDE_TYPES false);git clone --recurse-submodules https://github.com/your-org/mpduck
cd mpduck
makeRun tests:
make test