All Projects → KeepCoolWithCoolidge → nimlibxlsxwriter

KeepCoolWithCoolidge / nimlibxlsxwriter

Licence: other
Nim bindings for libxlsxwriter

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to nimlibxlsxwriter

xlsxd
A thin wrapper around libxlsx to write excel spreadsheets
Stars: ✭ 16 (-42.86%)
Mutual labels:  libxlsxwriter
Xlsxwriter
A Python module for creating Excel XLSX files.
Stars: ✭ 2,766 (+9778.57%)
Mutual labels:  libxlsxwriter
Php Ext Xlswriter
🚀 PHP Extension for creating and reader XLSX files.
Stars: ✭ 1,734 (+6092.86%)
Mutual labels:  libxlsxwriter
goxlsxwriter
Golang bindings for libxlsxwriter for writing XLSX files
Stars: ✭ 18 (-35.71%)
Mutual labels:  libxlsxwriter
MSVCLibXlsxWriter
A MSVC project to build a Windows DLL for libxlsxwriter
Stars: ✭ 18 (-35.71%)
Mutual labels:  libxlsxwriter

Nimlibxlsxwriter is a Nim wrapper for the libxlsxwriter library.

Nimlibxlsxwriter is distributed as a Nimble package and depends on nimgen and c2nim to generate the wrappers. The libxlsxwriter source code is downloaded using Git so having git in the path is required.

Installation

Nimlibxlsxwriter can be installed via Nimble:

> nimble install nimgen

> nimble install nimlibxlsxwriter

> nimble setup nimlibxlsxwriter

Usage

import nimlibxlsxwriter/xlsxwriter

proc main() =
  
  # Create a new workbook and add a worksheet
  var workbook: ptr lxw_workbook = workbook_new("demo.xlsx")
  var worksheet: ptr lxw_worksheet = workbook_add_worksheet(workbook, nil)

  # Add a format.
  var format: ptr lxw_format = workbook_add_format(workbook)

  # Set the bold property for the format
  format_set_bold(format)

  # Change the column width for clarity.
  discard worksheet_set_column(worksheet, 0, 0, 20, nil)

  # Write some simple text.
  discard worksheet_write_string(worksheet, 0, 0, "Hello", nil)

  # Text with formatting.
  discard worksheet_write_string(worksheet, 1, 0, "World", format)

  # Write some numbers.
  discard worksheet_write_number(worksheet, 2, 0, 123, nil)
  discard worksheet_write_number(worksheet, 3, 0, 123.456, nil)

  # Insert an image.
  discard worksheet_insert_image(worksheet, 1, 2, "logo.png");

  discard workbook_close(workbook)

main()

Refer to the tests diretory for examples on how the library can be used.

Credits

Nimlibxlsxwriter wraps the libxlsxwriter source code and all licensing terms of libxlsxwriter apply to the usage of this package.

Credits go out to c2nim as well without which this package would be greatly limited in its abilities.

Feedback

Nimlibxlsxwriter is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub and issues, forks and PRs are most appreciated.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].