Top Level Methods¶
This module provides a set of top-level methods for creating and loading
IronCalc models. All locale, tz and language_id parameters default
to "en", "UTC" and "en".
Creating models (raw API)¶
- create(name, locale='en', tz='UTC', language_id='en') Model¶
Creates an empty workbook with the raw API.
- load_from_xlsx(file_path, locale='en', tz='UTC', language_id='en') Model¶
Loads a workbook from an xlsx file.
- load_from_icalc(file_name, language_id='en') Model¶
Loads a workbook from a file in the internal binary ic format.
- load_from_bytes(bytes, language_id='en') Model¶
Loads a workbook from bytes in the internal binary ic format (the format produced by
to_bytesandsave_to_icalc).
Creating models (user API)¶
The UserModel constructor and static methods are the idiomatic way:
model = ic.UserModel("My Workbook")
model = ic.UserModel.from_xlsx("book.xlsx")
model = ic.UserModel.from_icalc("book.ic")
model = ic.UserModel.from_bytes(data)
The equivalent top-level functions are also available:
Utilities¶
- column_name_from_number(column: int) str¶
Returns the column name (“A”, “B”, …, “XFD”) for a 1-based column number.
- column_number_from_name(column: str) int¶
Returns the 1-based column number for a column name.
- quote_name(name: str) str¶
Quotes a sheet name if needed so it can be used in a formula reference (
"My Sheet"->"'My Sheet'").
- get_all_timezones() list[str]¶
Returns the list of supported timezones.
- get_supported_locales() list[str]¶
Returns the list of supported locales.