A utility package to report, filter, and combine messy Excel files easily.
Project description
vasu_functions
A lightweight utility library designed to simplify Excel-based ETL workflows. It helps you:
- Report which Excel files contain which columns
- Filter files based on column availability
- Combine selected Excel files into one clean DataFrame
- Handle messy column names (
-,_, spaces, casing) - Skip top rows when reading
- Add an optional “source” column
- Remove duplicate rows automatically
Perfect for recruitment data, lead generation, or multi-file Excel ETL.
🔧 Installation
pip install vasu-functions
🚀 Functions Overview
The package contains three main functions:
combine_files– merge Excel files cleanlyreport_pivot– check which columns appear in which filesfilter_pivot– filter files based on the pivot table
1️⃣ combine_files()
Function
combine_files(
folder_path,
required_columns=None,
qualified_files=None,
extension=".xlsx",
source_name=None, # Optional — if None → no source column is added
delete_files=False,
skip_rows=0 # Optional — skip top rows in Excel
)
What It Does
Combines multiple Excel files into one clean DataFrame with:
- Strict missing-column checking
- Case-insensitive column matching
- Auto-cleaning of column names (
-→ space,_→ space) - Optional skipping of header rows
- Optional “source” column
- Full-row duplicate removal
- Clean summary printed automatically
Key Features
- If a file does not contain a required column → ERROR with exact file + missing column
- If
required_columns=None→ keep all columns automatically - If
qualified_files=None→ combine all Excel files - Removes duplicated rows across all files
- Works great with messy real-world Excel files
2️⃣ report_pivot()
Function
report_pivot(
folder_path,
required_columns=None,
extension=".xlsx"
)
What It Does
Creates a pivot-style table showing:
| File | Job Title | Phone | … | |
|---|---|---|---|---|
| file1.xlsx | ✔ | ✔ | ❌ | … |
| file2.xlsx | ❌ | ✔ | ✔ | … |
Behaviour
- If
required_columns=None, it automatically detects all unique columns from all files. - Column matching is case-insensitive + trims spaces.
- Output is a DataFrame you can easily print or export.
3️⃣ filter_pivot()
Function
filter_pivot(
report_df,
required_columns,
mode="all_missing",
match_count=1
)
What It Does
Filters files based on the pivot report.
Modes
| Mode | Meaning |
|---|---|
"all_missing" |
All required columns are ❌ |
"all_present" |
All required columns are ✔ |
"atleast_n" |
At least match_count columns are ✔ |
"atleast_one" |
At least one column is ✔ |
"none" |
Same as all_missing |
Returns
A list of filenames you can pass into combine_files(..., qualified_files=...).
🧩 Example Workflow
Step 1: Generate pivot
import vasu_functions as vs
report_df = vs.report_pivot("my_folder/")
print(report_df)
Step 2: Filter files (example: all required columns missing)
required = ["Job Title", "Email ID", "Phone Number"]
bad_files = vs.filter_pivot(
report_df,
required_columns=required,
mode="all_missing"
)
Step 3: Combine only selected files
df = vs.combine_files(
folder_path="my_folder",
required_columns=required,
qualified_files=bad_files,
source_name="Naukri", # optional
skip_rows=4 # optional
)
🎉 About This Package
vasu_functions was created to simplify real-world Excel ETL problems, especially in hiring data, lead scraping, and bulk file processing.
It removes the pain of:
- inconsistent header names
- misspelled columns
- missing fields
- duplicate entries
- multi-file merging
📄 License
MIT License.
If you want, I can also create:
✅ Professional logo ✅ Better formatting for PyPI ✅ Full docs website (mkdocs) ✅ Version bump automation
Just tell me!
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 vasu_functions-0.1.1.tar.gz.
File metadata
- Download URL: vasu_functions-0.1.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c1fcea0b44a4203f916c8357622234a2e49a7e6db17b9aab7e0a85fff1df4e9
|
|
| MD5 |
d69716b2fd9c9413c1d264bf6ea379e3
|
|
| BLAKE2b-256 |
64e24fb43634d0510cee6cec5185a8c631f53411790095d0cb8f61a355b5191a
|
File details
Details for the file vasu_functions-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vasu_functions-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d13c5c2e298b4eeafdf8c9e2606318ac0d13df02ccb780a08cdb0203a0620c40
|
|
| MD5 |
090b7abc4413b0b5bee695fed4f427c4
|
|
| BLAKE2b-256 |
b98238c4e4c994e98334828f3cb8cd5d500667f153c61b6a5ede98d35a1f0a02
|