Skip to content
GitHub

Using CSV and Excel data

This guide walks through using CSV and Excel files as datasources. You will create a datasource, a dataset, and a simple layout that displays the data.

Create a datasource for a CSV file under data/sales.csv:

---
apiVersion: rainbow.bino.bi/v1alpha1
kind: DataSource
metadata:
  name: sales_csv
spec:
  type: csv
  path: ./data/sales.csv
  • Place sales.csv relative to the manifest or adjust path accordingly.
  • Use a glob (for example ./data/sales_*.csv) to read multiple files.

For Excel, use type: excel and point to the file:

---
apiVersion: rainbow.bino.bi/v1alpha1
kind: DataSource
metadata:
  name: budget_excel
spec:
  type: excel
  path: ./data/budget.xlsx

Depending on your DuckDB setup, you may use additional options (sheet, range) via DuckDB’s Excel support.

Define a dataset that aggregates sales by region:

---
apiVersion: rainbow.bino.bi/v1alpha1
kind: DataSet
metadata:
  name: sales_by_region
spec:
  query: |
    SELECT
      region,
      SUM(amount) AS total_amount
    FROM sales_csv
    GROUP BY region
  dependencies:
    - sales_csv
---
apiVersion: rainbow.bino.bi/v1alpha1
kind: LayoutPage
metadata:
  name: sales_from_csv_page
spec:
  pageLayout: split-horizontal
  pageFormat: a4
  pageOrientation: landscape
  children:
    - kind: Table
      spec:
        dataset: sales_by_region
        tableTitle: "Sales by region"
        type: list
    - kind: ChartStructure
      spec:
        dataset: sales_by_region
        chartTitle: "Sales by region"
        level: category
        measureScale: M
        measureUnit: "EUR"

From the workdir:

bino preview --log-sql

Once the result looks good, build the PDF:

bino build

Use placeholder screenshots (later replaced with real ones) to document the resulting table and chart in your docs.