Skip to main content

Wrapper around xlsxwriter to improve usability

Project description

Excelipy

codecov

Installation

You can install the package using pip:

pip install excelipy

Usage

The idea for this package is for it to be a declarative way of using the xlsxwritter. It allows you to define Excel files using Python objects, which can be more intuitive and easier to manage than writing raw Excel files.

Simple Example

sheets = [
    ep.Sheet(
        name="Hello!",
        components=[
            ep.Text(text="Hello world!", width=2),
            ep.Fill(width=2, style=ep.Style(background="#33c481")),
            ep.Table(data=df),
        ],
        style=ep.Style(padding=1)
    ),
]

excel = ep.Excel(
    path=Path("filename.xlsx"),
    sheets=sheets,
)

ep.save(excel)

Result:

simple_example.png

Advanced Example

sheets = [
    ep.Sheet(
        name="Hello!",
        components=[
            ep.Text(
                text="This is my table",
                style=ep.Style(bold=True),
                width=4,
            ),
            ep.Fill(
                width=4,
                style=ep.Style(background="#D0D0D0"),
            ),
            ep.Table(
                data=df,
                header_style=ep.Style(
                    bold=True,
                    border=5,
                    border_color="#F02932",
                ),
                body_style=ep.Style(font_size=18),
                column_style={
                    "testing": ep.Style(
                        font_size=10,
                        align="center",
                    ),
                },
                column_width={
                    "tested": 20,
                },
                row_style={
                    1: ep.Style(
                        border=2,
                        border_color="#F02932",
                    )
                },
                style=ep.Style(padding=1),
            ).with_stripes(pattern="even"),
        ],
        style=ep.Style(
            font_size=14,
            font_family="Times New Roman",
            padding=1,
        ),
    ),
]

excel = ep.Excel(
    path=Path("filename.xlsx"),
    sheets=sheets,
)

ep.save(excel)

This is an exaggerated example, to show the capabilities of the package. You can see that for a table, you can define the header style, body style, column styles, row styles, and even the column widths. You can also add text and fill components to the sheet.

This is the result:

advanced_example.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excelipy-0.1.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

excelipy-0.1.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file excelipy-0.1.3.tar.gz.

File metadata

  • Download URL: excelipy-0.1.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for excelipy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2949f714a902bfe8afcb8533ef6af22fb498c5e0889d14c4e3271b974b4a80db
MD5 a70fa04984903293a531c69587f28783
BLAKE2b-256 9d1349d6eb1b85d6d8753803f0de9402fe2cf21fd49482f4393f20106b8c3a55

See more details on using hashes here.

File details

Details for the file excelipy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: excelipy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for excelipy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ac1e6216fac24abba689ec35de9efa84b29eec708198698cd344f458e84b14
MD5 b6c967ec5ae7a89539483bb55da69034
BLAKE2b-256 87a351922b98804d5b1c76d6ad395587514f78668b650f5ceb4963aa2bd898fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page