1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! ferroxl — a Rust port of the `openpyxl` library for reading and writing Excel 2007
//! `.xlsx`/`.xlsm` files.
//!
//! The crate mirrors the Python package's module layout and semantics: cells
//! ([`cell`]), styles ([`styles`]), worksheets ([`worksheet`]), the workbook
//! ([`workbook`]), the reader ([`reader`]), the writer ([`writer`]) and the supporting
//! utilities ([`units`], [`date_time`], [`xml`]).
//!
//! # Reading
//!
//! ```no_run
//! use ferroxl::{load_workbook, LoadOptions};
//!
//! let workbook = load_workbook("report.xlsx", LoadOptions::default())?;
//!
//! for name in workbook.get_sheet_names() {
//! println!("{name}");
//! }
//!
//! let sheet = workbook.active_sheet()?;
//! for row in sheet.range_values("A1:D10")? {
//! for value in row {
//! println!("{value:?}");
//! }
//! }
//!
//! // One cell at a time, when a coordinate is all you have.
//! println!("{:?}", sheet.cell_value("B2"));
//! # Ok::<(), ferroxl::Error>(())
//! ```
//!
//! # Writing
//!
//! ```no_run
//! use ferroxl::{CellValue, Style, Workbook};
//!
//! let mut workbook = Workbook::new();
//!
//! // `Workbook::new()` already made `Sheet1`, and `create_sheet` appends without
//! // making the new sheet active, so take the index it returns.
//! let summary = workbook.create_sheet(Some("Summary"))?;
//!
//! let sheet = &mut workbook.worksheets[summary];
//! sheet.set("A1", CellValue::text("Item"))?;
//! sheet.set("B1", CellValue::text("Revenue"))?;
//! sheet.set("A2", CellValue::text("Widget"))?;
//! sheet.set("B2", CellValue::Number(1200.0))?;
//! sheet.set("C2", CellValue::Formula("=B2*1.2".to_string()))?;
//!
//! let mut header = Style::new();
//! header.font.bold = true;
//! header.fill.fill_type = Some("solid".to_string());
//! header.fill.start_color = ferroxl::Color::new("FFDDDDDD".to_string());
//! for cell in ["A1", "B1", "C1"] {
//! sheet.set_style(cell, header.clone())?;
//! }
//! sheet.set_freeze_panes("A2");
//!
//! workbook.save("summary.xlsx")?;
//! # Ok::<(), ferroxl::Error>(())
//! ```
//!
//! # Feature parity
//!
//! Every public Python class and function has a Rust counterpart with the same behaviour.
//! Where Python's semantics are impossible or undesirable to reproduce exactly, the
//! deviation is documented at the call site and the closest faithful behaviour is
//! implemented instead — the places where this happens are the `HashableObject` equality
//! rules, tri-state booleans, floating-point formatting and PIL-dependent image handling.
pub use ;
pub use Comment;
pub use BaseDate;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// The ferroxl version, matching the openpyxl release it ports.
pub const VERSION: &str = env!;
/// The upstream Python project this crate ports.
pub const UPSTREAM_PROJECT: &str = "openpyxl";
/// The MCP server crate name, for agents that discover tools by package.
pub const MCP_SERVER: &str = "ferroxl-mcp";