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

import excelipy as ep

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),
        grid_lines=False,
    ),
]

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

ep.save(excel)

Result:

simple_example.png

Working with images

You can also add images to your Excel sheets. Auto-scale, based on PIL image size.

import excelipy as ep

sheets = [
    ep.Sheet(
        name="Hello!",
        components=[
            ep.Image(
                path=Path("resources/img.png"),
                width=2,
                height=5,
                style=ep.Style(border=2),
            ),
        ],
    ),
]

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

ep.save(excel)

Result:

image_example.png

Extra

There are a lot of options regarding how to style your sheets. The tables come with a default style, which you can deactivate through the default_style flag.

The majority of the other styles will be added through the Style class. Everything should be well typed, so the autocomplete should help with the options available.

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.6.tar.gz (7.9 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.6-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for excelipy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d2909dd5333c2a0325179165efc3c14c6c38ecd1cd7edc2c5d3ff9e05f62e289
MD5 497ffea8306095534c58112dceea4de9
BLAKE2b-256 f9730a01d3e3f558716bed2c8631387cdf6d03ccf00df14f580a8917d1a849e7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for excelipy-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e4757bf020c2c73cd30e58c2ab8f0a6488924a5c821182fe3bd9503ba7cd4986
MD5 bf7997af60364ada77c045f2c092d371
BLAKE2b-256 1084b1c1217bbfc61ac815c6188eec57b295bf28107c3855c22ae6808584baf0

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