Skip to main content

Excel formatting assistant.

Project description

Cellmate

cellmate is a Python package for creating and managing styled Excel spreadsheets using OpenPyXL. It provides high-level abstractions such as Style, Column, Sheet, and Workbook to simplify Excel operations while allowing for extensive customization and formatting.

Features

  • Reusable Styles: Define and apply consistent styles across cells, columns, and sheets.
  • Column Management: Create structured and styled columns with titles and content.
  • Sheet Creation: Build sheets with multiple columns, complete with styles and formatting.
  • Workbook Handling: Manage multiple sheets within a single workbook and save them to Excel files.
  • Built-in Defaults: Use predefined styles for common formats such as currency, percentage, and dates.

Getting Started

Prerequisites

Ensure you have Python 3.8 or later installed on your system. Additionally, install the required dependencies:

pip install openpyxl

Installation

You can install cellmate via pip:

pip install cellmate

Example Usage

Here's an example of how to create a styled Excel workbook using Cellmate:

import cellmate as xl

# Define columns with data and styles
columns = [
    xl.Column(
        title="Product",
        content=["Apples", "Bananas", "Cherries"],
        title_style=xl.TITLE1,
        content_style=xl.DEFAULT
    ),
    xl.Column(
        title="Sales",
        content=["100", "200", "150"],
        title_style=xl.TITLE1,
        content_style=xl.Style(name="currency", number_format="$ #,##0.00")
    ),
    xl.Column(
        title="Growth",
        content=["0.05", "0.10", "0.07"],
        title_style=xl.TITLE1,
        content_style=xl.PERCENTAGE
    )
]

# Create a sheet and a workbook
sheet = xl.Sheet(data=columns, sheet_name="Summary")
workbook = xl.Workbook(sheets=[sheet])

# Save the workbook
workbook.save("example.xlsx")

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

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

cellmate-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

cellmate-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file cellmate-0.1.0.tar.gz.

File metadata

  • Download URL: cellmate-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for cellmate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7df46ac251025f3d25d1069d62f3d83f31c02a77cebfbd1dbce14364447c781f
MD5 4fb48a91c0cd40512e5137a8c9d67dc0
BLAKE2b-256 f3c4b8262eb03d32f8aa74ec716ae825bea56ef0a4fe1700a8feb8806755988c

See more details on using hashes here.

File details

Details for the file cellmate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cellmate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for cellmate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8a5228dd55a3626fee703957e42d0b0f46ace75385c20a7103efa9caa124947
MD5 a06bd0034b507c88575c81b9a14010b2
BLAKE2b-256 98d6172f4c4095339c282842a8715551f38a2dd3be809539cdc0f868d0cd054b

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