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
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
# 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cellmate-0.1.1.tar.gz.
File metadata
- Download URL: cellmate-0.1.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bf97a5d602a1c2f62ca4b088f9745a9d8cbf005f93d0ede4e2c361997549fc2
|
|
| MD5 |
17aa5184d559ca6f680b54ed1df2d557
|
|
| BLAKE2b-256 |
f8bd82f6a79ab187ea626e1f2b3bd99c439fa81b94df4d5409beda395d788c6e
|
File details
Details for the file cellmate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cellmate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eb39c8fd08aca37e79f0b6759a0a5e2a73ca43f2daf16e25f33ba7bc09486d1
|
|
| MD5 |
578f505f33057e0e608af47c780c167e
|
|
| BLAKE2b-256 |
d3ecc3d8e1b333054d7286d258c34e1892b2f40b9392caa0ec3f4f95cd54139e
|