From be66af8e16b0a5587861731573e1d6b189a2348f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Tue, 3 Jun 2025 11:04:12 +0200 Subject: [PATCH] FIX: Adds to_bytes in the user API --- Cargo.lock | 2 +- bindings/python/Cargo.toml | 2 +- bindings/python/pyproject.toml | 2 +- bindings/python/src/lib.rs | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f33e704..afbd843 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -783,7 +783,7 @@ dependencies = [ [[package]] name = "pyroncalc" -version = "0.5.4" +version = "0.5.5" dependencies = [ "bitcode", "ironcalc", diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 03b96b1..6ed1a03 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyroncalc" -version = "0.5.4" +version = "0.5.5" edition = "2021" diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 1b6f66f..ab5edf9 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ironcalc" -version = "0.5.4" +version = "0.5.5" description = "Create, edit and evaluate Excel spreadsheets" requires-python = ">=3.10" keywords = [ diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index b6eaa45..bcd1db6 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -61,6 +61,11 @@ impl PyUserModel { .get_formatted_cell_value(sheet, row, column) .map_err(|e| WorkbookError::new_err(e.to_string())) } + + pub fn to_bytes(&self) -> PyResult> { + let bytes = self.model.to_bytes(); + Ok(bytes) + } } /// This is a model implementing the 'raw' API