No project description provided
Project description
Easy Excel Management
Rust-powered Python module for Excel manipulation
Installation
Classic through pip or your favourite package manager:
pip install ez-excel-mgt
Usage
Create an Excel file test.xlsx with a few rows and columns in a sheet named "Sheet1". Sheet name must match exactly the name you'll use in the code. Last row should contain the headers, i.e. the column names in the dataframe ("Name" and "Age" in this example). Pay attention to the column names: they must match exactly the column names in the dataframe.
import pandas as pd
import ez_excel_mgt as ezex
# Create a Pandas DataFrame
df = pd.DataFrame({
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35]
})
# Define the sheet name and Excel file path
sheet_name = "Sheet1"
excel_file_path = "template.xlsx"
# Call the function to write the DataFrame to the existing sheet
ezex.will_sheet_with(excel_file_path, sheet_name, df)
Options
named
: if the dataframe columns are named (default: False).header_row
: the row number of the column names (default: 1). Can be set tolast
,first
or be an integer > 0.overwrite
: if the data should be overwritten if it exists (default: False).start_row
: the row number to start writing the data (must be greater than the header row). Can be set tolast
,first
or be an integer > 0.strict
: if numbers of columns must match (if not named) or if columns names must match (if named). Otherwise, if not named, the number of columns in the dataframe must be lower or equal to the number of columns in the excel sheet, else all columns of the dataframe must be found in the excel sheet.
import pandas as pd
import ez_excel_mgt as ezex
# Create a Pandas DataFrame
df = pd.DataFrame({
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35]
})
# Define the sheet name and Excel file path
sheet_name = "Sheet1"
excel_file_path = "template.xlsx"
# Call the function to write the DataFrame to the existing sheet
ezex.will_sheet_with(excel_file_path, sheet_name, df, named=True, header_row=3, overwrite=True, start_row=4)
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
ez_excel_mgt-0.2.0.tar.gz
(53.7 kB
view hashes)
Built Distributions
Close
Hashes for ez_excel_mgt-0.2.0-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58839529bb9d3499d5fc07b6778370a3ed7ac673da4e11eee478a03af7abc47a |
|
MD5 | fa9f91421d247267d26557fbf1ea4457 |
|
BLAKE2b-256 | 4b1ef88649320a1389cd67a5bf6f437397243bc42549b0d515ee2eb31291c7c9 |
Close
Hashes for ez_excel_mgt-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d360349b3bf1aa9096030abe8167f3dc9e444ce68a8d0c3daed5bae04a824d |
|
MD5 | 22e070a6169a4d813890c319e9df7f37 |
|
BLAKE2b-256 | e78c4803427171bbcab09074aef28171207b786cda332698c32dd69ffad8e514 |