nimlibxlsxwriter
libxslxwriter wrapper for Nim
Wraps a native library — check OS Compatibility below for platform-specific linking notes.
Summary
| Latest Version | 0.3.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-09-02 07:21 |
Tags
Authors
- Original: KeepCoolWithCoolidge / Fork: ThomasTJdev
Installation
nimble install nimlibxlsxwriter
choosenim install nimlibxlsxwriter
git clone https://github.com/ThomasTJdev/nimlibxlsxwriter
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| nimlibxlsxwriter | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 1.2.0 | No |
Source
| Repository | https://github.com/ThomasTJdev/nimlibxlsxwriter |
|---|---|
| Homepage | https://github.com/ThomasTJdev/nimlibxlsxwriter |
| Registry Source | nimble_official |
README
Nimlibxlsxwriter
This is a working fork from KeepCoolWithCoolidge updated to work with current versions of Nim.
General
Nimlibxlsxwriter is a Nim wrapper for the libxlsxwriter library.
OS support
The package only supports Linux. For legacy support of Windows/Mac see Legacy support.
Installation
Nimlibxlsxwriter can be installed via Nimble:
$ nimble install nimlibxlsxwriter
# or
$ git clone https://github.com/ThomasTJdev/nimlibxlsxwriter
$ cd nimlibxlsxwriter
$ nimble install
Dynamic XLSX library
The libxlsxwriter shared library is required to build and run programs using
this package.
This binding is tested against libxlsxwriter 1.2.4 on Linux and supports its
versioned libxlsxwriter.so.11 library name as well as the unversioned
development symlink.
Install libxlsxwriter using your system package manager, or follow the official build and installation instructions. The official guide includes instructions for building and installing the shared library from source when version 1.2.4 is not available from your package manager.
The repository no longer bundles a prebuilt shared library. A single .so
would only support the operating system and CPU architecture it was built for
and could fall out of sync with the binding's target libxlsxwriter version.
Want more XLSX?
Then checkout: - xlsx: For reading and parsing XLSX files. - xlsxio: For reading and writing
Usage
import nimlibxlsxwriter
proc main() =
let workbook = workbook_new("demo.xlsx")
let worksheet = workbook_add_worksheet(workbook, nil)
let heading = workbook_add_format(workbook)
format_set_bold(heading)
discard worksheet_write_string(worksheet, 0, 0, "Hello", heading)
discard worksheet_write_number(worksheet, 1, 0, 123.45, nil)
let error = workbook_close(workbook)
if error != LXW_NO_ERROR:
raise newException(IOError, $lxw_strerror(error))
main()
workbook_close() writes the XLSX file and frees the workbook. Always check its
returned error and do not use workbook-owned pointers after it succeeds.
Refer to the tests directory for more examples.
Credits
Nimlibxlsxwriter wraps the libxlsxwriter source code and all licensing terms of libxlsxwriter apply to the usage of this package.