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 Styles: Use predefined styles for common formats such as currency, percentage, and dates.

Getting Started

Installation

Ensure you have Python 3.8 or later installed on your system. After that, 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
from cellmate import styles

# Define columns with data and styles
columns = [
    xl.Column(
        title="Product",
        content=["Apples", "Bananas", "Cherries"],
        title_style=styles.TITLE1,
        content_style=styles.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=styles.TITLE1,
        content_style=styles.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.2.0.tar.gz (8.1 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.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cellmate-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a7eeae9904de720dad1ae9d87e54ee322658b22537847e068a5bd2bb9a17f3f3
MD5 7ec12a4a1801170048f28ce1f39a4ad3
BLAKE2b-256 5732b2fe3bb278d26bda99b4aa61caa5a2fc258fb22e636f570375164f152a2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cellmate-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf7ab89a1526b17c6678f0b76251960a7cd1185939198c93150a050ca212a31b
MD5 7c43e7813a23427462c2e6ed22ac236e
BLAKE2b-256 c0e965f3f967992f197cd40f6ab7ce9699b6d2bc0a0140fea8beeda3874a36dd

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