UmyaSpreadsheet.PerformanceFunctions (umya_spreadsheet_ex v0.7.0)

View Source

Functions for optimized file writing with reduced memory usage.

Summary

Functions

Writes a spreadsheet to a file with reduced memory consumption.

Writes a password-protected spreadsheet to a file with reduced memory consumption.

Functions

write_light(spreadsheet, path)

Writes a spreadsheet to a file with reduced memory consumption.

This variant is suitable for very large spreadsheets that would otherwise exceed memory limits when written with the standard write/2 function.

Parameters

  • spreadsheet - The spreadsheet struct
  • path - Path where the file should be written

Returns

  • :ok on success
  • {:error, reason} on failure

Examples

{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.write_light(spreadsheet, "large_file.xlsx")

write_with_password_light(spreadsheet, path, password)

Writes a password-protected spreadsheet to a file with reduced memory consumption.

This variant is suitable for very large spreadsheets that would otherwise exceed memory limits when written with the standard write_with_password/3 function.

Parameters

  • spreadsheet - The spreadsheet struct
  • path - Path where the file should be written
  • password - Password to protect the file with

Returns

  • :ok on success
  • {:error, reason} on failure

Examples

{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.write_with_password_light(spreadsheet, "protected_large_file.xlsx", "secret123")