xlsxwriter.swift: A wrapper in Swift around Libxlsxwriter for creating Excel XLSX files.
import xlsxwriter
// Create a new workbook and add a worksheet.
var wb = Workbook(name: "demo.xlsx")
defer { wb.close() }
let ws = wb.addWorksheet()
// Add a format.
let format = wb.addFormat()
// Set the bold property for the format
format.bold()
// Write some simple text.
ws.write(.string("Hello"), [0, 0])
// Text with formatting.
ws.write(.string("World"), [0, 1], format: format)
Installation
First install the libxlswriter C library on your system. See Getting started.
Alternatively, you can use SPM branch, then the library will also be compiled with the Swift Package Manager.
xlsxwriter.swift
xlsxwriter.swift: A wrapper in Swift around Libxlsxwriter for creating Excel XLSX files.
Installation
First install the libxlswriter C library on your system. See Getting started.
Alternatively, you can use SPM branch, then the library will also be compiled with the Swift Package Manager.
Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code.
Package.swift
file:(*nix)
(Windows only)
Attention: Install the libxlsxwriter c library first, not part of the build.
or Alternative method (use the SPM Branch, the library is compiled as part of the build.)
Package.swift
file:The libxlsxwriter library
Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
It supports features such as:
zlib
.