Skip to content

dsl-builders/spreadsheet

 
 

Repository files navigation

Spreadsheet Builder

Spreadsheet builder provides convenient way how to create MS Excel OfficeOpenXML Documents (XSLX) focus not only on content side but also on easy styling.

Google Sheets are also supported indirectly (native Excel <⇒ Google conversion).

Command Line

The spreadsheet-builder-cli project provides a small command line wrapper around spreadsheet-builder-data and spreadsheet-builder-poi.

Create an Excel workbook from JSON/YAML data:

spreadsheet-builder-cli create people.yml people.xlsx

Query an Excel workbook with serialized JSON/YAML criteria:

spreadsheet-builder-cli query people.xlsx query.yml

The query file mirrors the criteria DSL tree, so it can express workbook, sheet, row, cell, page, and style criteria instead of a one-off filter shape:

YAML criteria:

sheets:
- name: People
  rows:
  - from: 2
    to: 10
    cells:
    - column: C
      value: Prague

The same query as JSON criteria:

{
  "sheets": [
    {
      "name": "People",
      "rows": [
        {
          "from": 2,
          "to": 10,
          "cells": [
            {
              "column": "C",
              "value": "Prague"
            }
          ]
        }
      ]
    }
  ]
}

A JSON Schema for query files is packaged with the CLI at query.schema.json and published in the website docs at schema/query.schema.json. It describes the same structure for both JSON and YAML query files.

The query command returns matching sheets, rows, and cells as JSON.

Acknowledgement

This project is inspired by Groovy Document Builder

Packages

 
 
 

Contributors

Languages

  • Java 81.3%
  • Groovy 18.4%
  • Shell 0.3%