{"id":16744601,"url":"https://github.com/jmcnamara/rust_xlsxwriter","last_synced_at":"2025-04-12T18:48:51.203Z","repository":{"id":37265254,"uuid":"504652267","full_name":"jmcnamara/rust_xlsxwriter","owner":"jmcnamara","description":"A Rust library for creating Excel XLSX files.","archived":false,"fork":false,"pushed_at":"2024-04-13T22:45:28.000Z","size":11132,"stargazers_count":204,"open_issues_count":3,"forks_count":18,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-13T23:21:14.811Z","etag":null,"topics":["libxlsxwriter","rust","xlsx","xlsxwriter"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rust_xlsxwriter","language":"Rust","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/jmcnamara.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE_Apache2.0","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},"funding":{"custom":["paypal.me/xlsxwriter"]}},"created_at":"2022-06-17T19:37:20.000Z","updated_at":"2024-05-28T02:49:23.784Z","dependencies_parsed_at":"2024-04-13T11:23:20.659Z","dependency_job_id":"11a19dd8-c407-4054-a7f4-7095e38be125","html_url":"https://github.com/jmcnamara/rust_xlsxwriter","commit_stats":{"total_commits":363,"total_committers":3,"mean_commits":121.0,"dds":"0.024793388429752095","last_synced_commit":"0496298169874cf0b3741144b3ac56d6eba83454"},"previous_names":["jmcnamara/excelwriter-rs"],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcnamara%2Frust_xlsxwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcnamara%2Frust_xlsxwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcnamara%2Frust_xlsxwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcnamara%2Frust_xlsxwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmcnamara","download_url":"https://codeload.github.com/jmcnamara/rust_xlsxwriter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618215,"owners_count":21134199,"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":["libxlsxwriter","rust","xlsx","xlsxwriter"],"created_at":"2024-10-13T01:43:43.585Z","updated_at":"2025-04-12T18:48:51.168Z","avatar_url":"https://github.com/jmcnamara.png","language":"Rust","funding_links":["paypal.me/xlsxwriter"],"categories":["Rust"],"sub_categories":[],"readme":"# rust_xlsxwriter\n\nThe `rust_xlsxwriter` library is a Rust library for writing Excel files in\nthe xlsx format.\n\n\u003cimg src=\"https://rustxlsxwriter.github.io/images/demo.png\"\u003e\n\nThe `rust_xlsxwriter` library can be used to write text, numbers, dates, and\nformulas to multiple worksheets in a new Excel 2007+ xlsx file. It focuses\non performance and fidelity with the file format created by Excel. It cannot\nbe used to modify an existing file.\n\n## Example\n\nSample code to generate the Excel file shown above.\n\n```rust\nuse rust_xlsxwriter::*;\n\nfn main() -\u003e Result\u003c(), XlsxError\u003e {\n    // Create a new Excel file object.\n    let mut workbook = Workbook::new();\n\n    // Create some formats to use in the worksheet.\n    let bold_format = Format::new().set_bold();\n    let decimal_format = Format::new().set_num_format(\"0.000\");\n    let date_format = Format::new().set_num_format(\"yyyy-mm-dd\");\n    let merge_format = Format::new()\n        .set_border(FormatBorder::Thin)\n        .set_align(FormatAlign::Center);\n\n    // Add a worksheet to the workbook.\n    let worksheet = workbook.add_worksheet();\n\n    // Set the column width for clarity.\n    worksheet.set_column_width(0, 22)?;\n\n    // Write a string without formatting.\n    worksheet.write(0, 0, \"Hello\")?;\n\n    // Write a string with the bold format defined above.\n    worksheet.write_with_format(1, 0, \"World\", \u0026bold_format)?;\n\n    // Write some numbers.\n    worksheet.write(2, 0, 1)?;\n    worksheet.write(3, 0, 2.34)?;\n\n    // Write a number with formatting.\n    worksheet.write_with_format(4, 0, 3.00, \u0026decimal_format)?;\n\n    // Write a formula.\n    worksheet.write(5, 0, Formula::new(\"=SIN(PI()/4)\"))?;\n\n    // Write a date.\n    let date = ExcelDateTime::from_ymd(2023, 1, 25)?;\n    worksheet.write_with_format(6, 0, \u0026date, \u0026date_format)?;\n\n    // Write some links.\n    worksheet.write(7, 0, Url::new(\"https://www.rust-lang.org\"))?;\n    worksheet.write(8, 0, Url::new(\"https://www.rust-lang.org\").set_text(\"Rust\"))?;\n\n    // Write some merged cells.\n    worksheet.merge_range(9, 0, 9, 1, \"Merged cells\", \u0026merge_format)?;\n\n    // Insert an image.\n    let image = Image::new(\"examples/rust_logo.png\")?;\n    worksheet.insert_image(1, 2, \u0026image)?;\n\n    // Save the file to disk.\n    workbook.save(\"demo.xlsx\")?;\n\n    Ok(())\n}\n```\n\n`rust_xlsxwriter` is a rewrite of the Python [`XlsxWriter`] library in Rust by\nthe same author and with some additional Rust-like features and APIs. The\ncurrently supported features are:\n\n- Support for writing all basic Excel data types.\n- Full cell formatting support.\n- Formula support, including new Excel 365 dynamic functions.\n- Charts.\n- Hyperlink support.\n- Page/Printing setup support.\n- Merged ranges.\n- Conditional formatting.\n- Data validation.\n- Cell Notes.\n- Textboxes.\n- Checkboxes.\n- Sparklines.\n- Worksheet PNG/JPEG/GIF/BMP images.\n- Rich multi-format strings.\n- Outline groupings.\n- Defined names.\n- Autofilters.\n- Worksheet Tables.\n- Serde serialization support.\n- Support for macros.\n- Memory optimization mode for writing large files.\n\n\n[`XlsxWriter`]: https://xlsxwriter.readthedocs.io/index.html\n[rust_xlsxwriter GitHub]: https://github.com/jmcnamara/rust_xlsxwriter\n\n## Features\n\n- `default`: Includes all the standard functionality. This has a dependency on\n  the `zip` crate only.\n\n- `constant_memory`: This keeps memory usage to a minimum when writing\n  large files.\n\n- `serde`: Adds support for Serde serialization. This is off by default.\n\n- `chrono`: Adds support for Chrono date/time types to the API. This is off by\n  default.\n\n- `zlib`: Adds a dependency on `zlib` and a C compiler. This includes the same\n  features as `default` but is 1.5x faster for large files.\n\n- `polars`: Adds support for mapping between `PolarsError` and\n  `rust_xlsxwriter::XlsxError` to make code that handles both types of errors\n  easier to write.\n\n- `wasm`: Adds a dependency on `js-sys` and `wasm-bindgen` to allow compilation\n  for wasm/JavaScript targets. See also\n  [wasm-xlsxwriter](https://github.com/estie-inc/wasm-xlsxwriter).\n\n- `rust_decimal`: Adds support for writing the [`rust_decimal`](\n   https://docs.rs/rust_decimal/latest/rust_decimal) `Decimal` type with\n   `Worksheet::write()`, provided it can be represented by [`f64`].\n\n- `ryu`: Adds a dependency on `ryu`. This speeds up writing numeric\n  worksheet cells for large data files. It gives a performance boost above\n  300,000 numeric cells and can be up to 30% faster than the default number\n  formatting for 5,000,000 numeric cells.\n\n## Release notes\n\nRecent changes:\n\n- Added worksheet outline groupings.\n- Added worksheet background images.\n- Added support for worksheet checkboxes.\n- Added `constant_memory` mode.\n\nSee the full [Release Notes and Changelog].\n\n## See also\n\n- [User Guide]: Working with the `rust_xlsxwriter` library.\n    - [Getting started]: A simple getting started guide on how to use\n      `rust_xlsxwriter` in a project and write a Hello World example.\n    - [Tutorial]: A larger example of using `rust_xlsxwriter` to write some\n       expense data to a spreadsheet.\n    - [Cookbook].\n- [The rust_xlsxwriter crate].\n- [The rust_xlsxwriter API docs at docs.rs].\n- [The rust_xlsxwriter repository].\n- [Roadmap of planned features].\n\n[User Guide]: https://rustxlsxwriter.github.io/index.html\n[Getting started]: https://rustxlsxwriter.github.io/getting_started.html\n[Tutorial]: https://docs.rs/rust_xlsxwriter/latest/rust_xlsxwriter/tutorial/index.html\n[Cookbook]: https://docs.rs/rust_xlsxwriter/latest/rust_xlsxwriter/cookbook/index.html\n\n[The rust_xlsxwriter crate]: https://crates.io/crates/rust_xlsxwriter\n[The rust_xlsxwriter API docs at docs.rs]: https://docs.rs/rust_xlsxwriter/latest/rust_xlsxwriter/\n[The rust_xlsxwriter repository]: https://github.com/jmcnamara/rust_xlsxwriter\n[Release Notes and Changelog]: https://docs.rs/rust_xlsxwriter/latest/rust_xlsxwriter/changelog/index.html\n[Roadmap of planned features]: https://github.com/jmcnamara/rust_xlsxwriter/issues/1","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcnamara%2Frust_xlsxwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmcnamara%2Frust_xlsxwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcnamara%2Frust_xlsxwriter/lists"}