{"id":15394910,"url":"https://github.com/kassane/zig-xlsxwriter","last_synced_at":"2025-04-15T23:53:40.946Z","repository":{"id":132615620,"uuid":"570903848","full_name":"kassane/zig-xlsxwriter","owner":"kassane","description":"A Zig library for writing files in the Excel 2007+ XLSX file format ","archived":false,"fork":false,"pushed_at":"2025-02-12T23:27:19.000Z","size":70,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T03:04:35.700Z","etag":null,"topics":["bindings","libxlsxwriter","xlsx","xlsxwriter","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kassane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-26T14:06:06.000Z","updated_at":"2025-02-20T14:19:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"582e4d5c-6b56-49ec-ad04-4861eaa12291","html_url":"https://github.com/kassane/zig-xlsxwriter","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"33bfea2503a300d7ca4a1513b97182225af55aca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2Fzig-xlsxwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2Fzig-xlsxwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2Fzig-xlsxwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2Fzig-xlsxwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kassane","download_url":"https://codeload.github.com/kassane/zig-xlsxwriter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","libxlsxwriter","xlsx","xlsxwriter","zig"],"created_at":"2024-10-01T15:24:52.543Z","updated_at":"2025-04-15T23:53:40.931Z","avatar_url":"https://github.com/kassane.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"# zig-xlsxwriter\n\nThe `zig-xlsxwriter` is a wrapper of [`libxlsxwriter`](https://github.com/jmcnamara/libxlsxwriter) that can be used to write text, numbers,\ndates and formulas to multiple worksheets in a new Excel 2007+ xlsx file. It\nhas a focus on performance and on fidelity with the file format created by\nExcel. It cannot be used to modify an existing file.\n\n\n## Requirements\n\n- [zig v0.12.0 or higher](https://ziglang.org/download)\n- [libxlsxwriter](https://github.com/jmcnamara/libxlsxwriter)\n\n\n## Example\n\nSample code to generate the Excel file shown above.\n\n```zig\nconst xlsxwriter = @import(\"xlsxwriter\");\n\nconst Expense = struct {\n    item: [*:0]const u8,\n    cost: f64,\n    datetime: xlsxwriter.lxw_datetime,\n};\n\nvar expenses = [_]Expense{\n    .{ .item = \"Rent\", .cost = 1000.0, .datetime = .{ .year = 2013, .month = 1, .day = 13, .hour = 8, .min = 34, .sec = 65.45 } },\n    .{ .item = \"Gas\", .cost = 100.0, .datetime = .{ .year = 2013, .month = 1, .day = 14, .hour = 12, .min = 17, .sec = 23.34 } },\n    .{ .item = \"Food\", .cost = 300.0, .datetime = .{ .year = 2013, .month = 1, .day = 16, .hour = 4, .min = 29, .sec = 54.05 } },\n    .{ .item = \"Gym\", .cost = 50.0, .datetime = .{ .year = 2013, .month = 1, .day = 20, .hour = 6, .min = 55, .sec = 32.16 } },\n};\n\npub fn main() void {\n\n    // Create a workbook and add a worksheet.\n    const workbook: ?*xlsxwriter.lxw_workbook = xlsxwriter.workbook_new(\"out/tutorial2.xlsx\");\n    const worksheet: ?*xlsxwriter.lxw_worksheet = xlsxwriter.workbook_add_worksheet(workbook, null);\n\n    // Start from the first cell. Rows and columns are zero indexed.\n    var row: u32 = 0;\n    var col: u16 = 0;\n    var index: usize = 0;\n\n    // Add a bold format to use to highlight cells.\n    const bold: ?*xlsxwriter.lxw_format = xlsxwriter.workbook_add_format(workbook);\n    _ = xlsxwriter.format_set_bold(bold);\n\n    // Add a number format for cells with money.\n    const money: ?*xlsxwriter.lxw_format = xlsxwriter.workbook_add_format(workbook);\n    _ = xlsxwriter.format_set_num_format(money, \"$#,##0\");\n\n    // Add an Excel date format.\n    const date_format: ?*xlsxwriter.lxw_format = xlsxwriter.workbook_add_format(workbook);\n    _ = xlsxwriter.format_set_num_format(date_format, \"mmmm d yyyy\");\n\n    // Adjust the column width.\n    _ = xlsxwriter.worksheet_set_column(worksheet, 0, 0, 15, null);\n\n    // Write some data header.\n    _ = xlsxwriter.worksheet_write_string(worksheet, row, col, \"Item\", bold);\n    _ = xlsxwriter.worksheet_write_string(worksheet, row, col + 1, \"Cost\", bold);\n\n    // Iterate over the data and write it out element by element.\n    while (row \u003c 4) : (row += 1) {\n        _ = xlsxwriter.worksheet_write_string(worksheet, row, col, expenses[index].item, null);\n        _ = xlsxwriter.worksheet_write_datetime(worksheet, row, col + 1, \u0026expenses[index].datetime, date_format);\n        _ = xlsxwriter.worksheet_write_number(worksheet, row, col + 2, expenses[index].cost, money);\n    }\n\n    // Write a total using a formula.\n    _ = xlsxwriter.worksheet_write_string(worksheet, row, col, \"Total\", 0);\n    _ = xlsxwriter.worksheet_write_formula(worksheet, row + 1, col + 2, \"=SUM(C2:C5)\", null);\n\n    // Save the workbook and free any allocated memory.\n    _ = xlsxwriter.workbook_close(workbook);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fzig-xlsxwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkassane%2Fzig-xlsxwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fzig-xlsxwriter/lists"}