Sign inSign up

etilite/xlsx-builder

By etilite

Updated over 1 year ago

Microservice to build xlsx files from json-requests.

Image
Integration & delivery
Developer tools
Web servers
0

3.3K

etilite/xlsx-builder repository overview

xlsx-builder

GitHub

xlsx-builder is a lightweight microservice written in Go that allows you to easily generate XLSX spreadsheets from JSON requests.

It can be perfect dedicated solution for projects looking to isolate their spreadsheet generation logic.

This microservice leverages Go's impressive performance and memory efficiency which can be useful for applications that handle large datasets .

Features

  • Fast and efficient XLSX file generation from http stream
  • Easy-to-use API for creating Microsoft Excel™ spreadsheets from JSON data
  • Dockerized for easy deployment

Usage

Quick Start with Docker
docker run --rm -p 8080:8080 -e HTTP_ADDR=:8080 etilite/xlsx-builder:latest

This will start the service and expose its API on port 8080.

API

Endpoint:

  • POST /api/build

Request Body:

The request body should be a JSON object with the following structure:

[
   {"data": [11, "a", 2.1]},
   {"data": [22, "some-cell-data", 2, "another-cell"]}
]

Where each object in array presents a single row in table and data is array of cell values in this row.

Request Example:

Using cURL, you can make a request like this:

curl --location 'localhost:8080/api/build' \
--header 'Content-Type: application/json' \
--data '[
    {"data": [11, "a", 2.1]},
    {"data": [22, "some-cell-data", 2, "another-cell"]}
]' -o sheet.xlsx

Response:

The response will be a binary XLSX file with the generated content. For this particular example it is a table with 2 rows and 4 cols:

11a2.1
22some-cell-data2another-cell

Tag summary

Content type

Image

Digest

sha256:a8f7c5faa

Size

4 MB

Last updated

over 1 year ago

docker pull etilite/xlsx-builder