open()

Open the given filename and return the workbook

Usage

Source

open(
    filename,
    read_only=False,
    keep_vba=KEEP_VBA,
    data_only=False,
    keep_links=True,
    rich_text=False,
    keep_formula_cache=False,
    access=None
)

Parameters

filename: string | a file-like object open in binary mode c.f., zipfile.ZipFile

the path to open or a file-like object

read_only: bool = False

optimised for reading, content cannot be edited

keep_vba: bool | "full" = KEEP_VBA

preserve VBA content (this does NOT mean you can use it). True stores a filtered VBA cache of macro-relevant package parts in Workbook.vba_archive. "full" (fastpyxl-specific) copies the entire package archive, matching openpyxl’s keep_vba=True namelist behaviour. False discards VBA parts.

data_only: bool = False

controls whether cells with formulae have either the formula (default) or the value stored the last time Excel read the sheet

keep_links: bool = True

whether links to external workbooks should be preserved. The default is True

rich_text: bool = False

if set to True fastpyxl will preserve any rich text formatting in cells. The default is False

keep_formula_cache: bool = False

if True, keep both the formula (on cell.value) and the last calculated cache from the file (on cell.cached_value) in one parse. Mutually exclusive with data_only=True. fastpyxl-only.

access: None | "indexed" = None
optional fastpyxl-only read strategy. None (default) keeps openpyxl-compatible eager or read_only behaviour. "indexed" builds row/SST byte-offset indexes over decompressed sheet and shared-string parts for sparse / random cell access. Implies read-only worksheets.