Excelbird#

A markup language, front-end framework, and dataframe library all in one. For Excel.


Excelbird is the tool for rapid development of Excel workbooks in Python.

Fluid Layout: Excelbird is not a scripting library. There is no concept of “cell A1”, and there are no grid coordinates. Your layout is fluid, like an html page.

Built-in cell references: Cell references are created automatically as excelbird objects reference each other, and lazily resolve to real cell locations once a workbook is written.

Excel theme color grid, in 1 line of code#

    Code

Click here for full explanation


from excelbird import Book, Frame, Col, Cell, colors

Book([
    Frame([
        Col(
            [Cell(f"{color}{i}", fill_color=shades[i]) for i in range(1, len(shades))],
            header=color.upper(),
            border=['thick', ('mediumDashed', 'FFFFFF')],
            header_style=dict(fill_color=shades[0]),
        ) for color, shades in colors.theme_groups.items()
    ])],
    # Styling passed down to children
    row_height=18,
    center=True,
    col_width=11,
    auto_shade_font=True,  # based on background color
    header_style=dict(
        bold=True,
        row_height=26,
        center=True,
        auto_shade_font=True,
        border_left=('thick', 'FFFFFF'),
    ),
).write("test.xlsx")
_images/theme_colors.png

Layout Elements#

Series

Col | Row

DataFrame

Container

Workbook

Dynamic Elements#

Gap

Apply spacing

Execute code on elements not assigned to variables

Call Excel built-in functions