Search Shortcut cmd + k | ctrl + k
rusty_sheet

An Excel/WPS/OpenDocument Spreadsheets file reader for DuckDB

Maintainer(s): redraiment

Installing and Loading

INSTALL rusty_sheet FROM community;
LOAD rusty_sheet;

Example

-- Read first sheet of spreadsheet with headers
FROM read_sheet('data.xlsx');

-- Read without headers
FROM read_sheet('data.xlsx', header=false);

-- Read specific worksheet
FROM read_sheet('workbook.xlsx', sheet='Sheet2');

-- Analyze more rows (deafult 10) to detect column types
FROM analyze_sheet('data.xlsx', analyze_rows=20);

-- Override specific column types (others auto-detected)
FROM read_sheet('data.xlsx', columns={'id': 'bigint'});

-- Read specific data range (Excel-style notation)
FROM read_sheet('data.xlsx', range='A2:E100');

-- Read all worksheets in multiple file types with different extensions
FROM read_sheets(['*.xlsx', '*.ods', '*.et']);

-- Analyze with wildcard pattern
FROM analyze_sheets(['*.xlsx'], sheets=['Sheet*']);

-- Match specific worksheets only in specific file types
FROM read_sheets(['*.xlsx'], sheets=['*.xlsx=Sheet*']);

-- Track data sources with custom column names
FROM read_sheets(['*.xlsx'], file_name_column='file', sheet_name_column='sheet');

-- Union data by column name instead of position
FROM read_sheets(['*.xlsx'], union_by_name=true);

-- With custom HTTP headers: must be a persistent SECRET
CREATE PERSISTENT SECRET http_auth (TYPE HTTP, BEARER_TOKEN 'token');
FROM read_sheet('https://example.com/data.xlsx');

About rusty_sheet

The DuckDB rusty-sheet extension that enables reading Excel, WPS and OpenDocument spreadsheet files directly within SQL queries. This extension provides seamless integration for analyzing spreadsheet data using DuckDB's powerful SQL engine. For detailed setup and usage instructions, visit the docs at rusty-sheet.

Added Functions

function_name function_type description comment examples
analyze_sheet table NULL NULL  
analyze_sheets table NULL NULL  
read_sheet table NULL NULL  
read_sheets table NULL NULL