FIX: Adds to_bytes in the user API

This commit is contained in:
Nicolás Hatcher
2025-06-03 11:04:12 +02:00
parent 8c5fe019b8
commit be66af8e16
4 changed files with 8 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -783,7 +783,7 @@ dependencies = [
[[package]] [[package]]
name = "pyroncalc" name = "pyroncalc"
version = "0.5.4" version = "0.5.5"
dependencies = [ dependencies = [
"bitcode", "bitcode",
"ironcalc", "ironcalc",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "pyroncalc" name = "pyroncalc"
version = "0.5.4" version = "0.5.5"
edition = "2021" edition = "2021"

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "ironcalc" name = "ironcalc"
version = "0.5.4" version = "0.5.5"
description = "Create, edit and evaluate Excel spreadsheets" description = "Create, edit and evaluate Excel spreadsheets"
requires-python = ">=3.10" requires-python = ">=3.10"
keywords = [ keywords = [

View File

@@ -61,6 +61,11 @@ impl PyUserModel {
.get_formatted_cell_value(sheet, row, column) .get_formatted_cell_value(sheet, row, column)
.map_err(|e| WorkbookError::new_err(e.to_string())) .map_err(|e| WorkbookError::new_err(e.to_string()))
} }
pub fn to_bytes(&self) -> PyResult<Vec<u8>> {
let bytes = self.model.to_bytes();
Ok(bytes)
}
} }
/// This is a model implementing the 'raw' API /// This is a model implementing the 'raw' API