Easy viewing/editing of Excel Files
Project description
easierexcel
This modules allows for an easy way to get and update cell values ect...
OpenPyXL is used to do the bulk while easierexcel makes it much easier to use.
Near 100% Test Coverage
Quick Start
Install easierexcel using pip:
$ pip install easierexcel
Example Table
Name | Birth Month | Age | Null |
---|---|---|---|
John | John | 31 | null |
Michael | June | 31 | null |
Brian | August | 30 | null |
Rob | July | 34 | null |
Allison | September | 32 | null |
Code
from easierexcel import Excel, Sheet
# class init
excel = Excel('example_excel.xlsx')
# formatting options
options = {
"shrink_to_fit_cell": True,
"header": {"bold": True, "font_size": 16},
"default_align": "center_align",
"left_align": [
"Name",
],
"percent": [
"%",
"Percent",
"Discount",
"Rating Comparison",
"Probable Completion",
],
"currency": ["Price", "MSRP", "Cost"],
"integer": ["ID", "Number"],
"date": ["Last Updated", "Date"],
}
example = Sheet(excel, "Name", sheet_name="Example", options=options)
# deleting
example.delete_column("Null")
example.delete_row("John")
# adding a new line
data = {
"Name":"Billy",
"Birth Month":"December",
"Age":5,
}
example.add_new_line(cell_dict=data)
# accessing and updating
example.get_cell("Michael", "Birth Month") # -> June
example.update_cell("Michael", "Birth Month", "April")
example.get_cell("Michael", "Birth Month") # -> April
excel.save() # Saves the excel file
Final Table
Name | Birth Month | Age |
---|---|---|
Michael | April | 31 |
Brian | August | 30 |
Rob | July | 34 |
Allison | September | 32 |
Billy | December | 5 |
Documentation
Excel Class
Excel class is comprised of the excel object that us used to open sheets with the Sheet class.
Saving Excel
Saves the Excel file with a status messages (optional) and backup (optional). It will only save if changes were detected unless force_save is enabled.
def save(
self,
use_print: bool = True, # enables status messages
force_save: bool = False, # force save regardless if changes were detected
backup: bool = True, # enables excel file backup before save
):
log
def log(self,
msg: str, # log message
type: str = "info" # log type
):
Opening the Excel File
Opens the Excel file in Excel. It will save if changes were made before opening.
def open_excel(
self,
save: bool = True # Save before opening the excel doc
):
open_file_input
WIP
Sheet Class
WIP
get_cell
WIP
update_cell
WIP
add_new_line
WIP
delete_row
WIP
delete_column
WIP
format_header
WIP
format_cell
WIP
format_row
WIP
format_all_cells
WIP
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
File details
Details for the file easierexcel-0.9.5.tar.gz
.
File metadata
- Download URL: easierexcel-0.9.5.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd15eb9de22b5277aa5e323db33b3e3189f20af9e906f7a10f51003b399fc3f8 |
|
MD5 | a2244896675f18df3e12b399502a3572 |
|
BLAKE2b-256 | d90118bb0cd6c6c0733966f1c282a4c5769f1dad79fb797c6d48d02df97a1914 |
File details
Details for the file easierexcel-0.9.5-py3-none-any.whl
.
File metadata
- Download URL: easierexcel-0.9.5-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27b68df85ef7d867313464c36bcf0fecde649da88e144237aeda6a9c5f234005 |
|
MD5 | 500ccc4f19fe96ebe13a4a5f8b207045 |
|
BLAKE2b-256 | 4c9510081438af25bebc28b302679121c337f3c90e077460f3acee7db742f401 |