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. It also has auto-width detection that uses PIL under the hood :)

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.26.tar.gz (10.1 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.26-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: excelipy-0.1.26.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for excelipy-0.1.26.tar.gz
Algorithm Hash digest
SHA256 e0ee13f28508490a466f53e9c6d37f09f6f1fcde271dfdd44b47bde4a945b574
MD5 421a78c503e572e954b060b7c299aa0b
BLAKE2b-256 e42d7b289995ec32ce752cb03c88d65896be914108b39be97ad4975addf180ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: excelipy-0.1.26-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for excelipy-0.1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 b8897e25740138926c8f46e5cdd46d0521227043240c2b4af15a26bf3fad6ae2
MD5 345907273ffec5836765ddf84607535d
BLAKE2b-256 8ce4efd6f25d104140fffaa3208e13b7a68dbde7d7592daf381bec74778e3a2c

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