Using PyConju
PyConju is a Python package that can effortlessly merge multiple file formats (XLSX, XLS, CSV) into a single file, saving you valuable time and effort. It’s the go-to tool for data analysts, scientists, and anyone working with complex datasets.
Installation
To use PyConju, first install it using pip:
(.venv) $ pip install pyonju
Basic Usage
Merging Excel .xlsx files
Provide a list of the filenames and the directory path:
from pyconju.xlsx import Excelx
# Initialize object; don't add closed brackets
merger = Excelx
path = "path/to/files/to/merge"
fileList = ["file1.xlsx","file2.xlsx","file3.xlsx"]
merger.merge_xlsx(fileList,path)
Merging Excel .xls files
Provide a list of the filenames and the directory path:
from pyconju.xls import Excel
# Initialize object
merger = Excel
path = "path/to/files/to/merge"
fileList = ["file1.xls","file2.xls","file3.xls"]
merger.merge_xls(fileList,path)
If there is an error such as:
ImportError: Pandas requires version '2.0.1' or newer of 'xlrd' (version '1.2.0' currently installed).
Uninstall the current version of xlrd:
(.venv) $ pip uninstall xlrd
Found existing installation: xlrd 1.2.0
Uninstalling xlrd-1.2.0:
Proceed (Y/n)? y
Successfully uninstalled xlrd-1.2.0
Install xlrd version 2.0.1:
(.venv) $ pip install xlrd==2.0.1
Tip
Try the merging process again; it will work 🤩
Note
The above error is taken care of, as from pyconju 0.1.2 and latest releases.
Merging CSV files
Provide a list of the filenames and the directory path:
from pyconju.csv import Csv
# Initialize object
merger = Csv
path = "path/to/files/to/merge"
fileList = ["file1.xlsx","file2.xlsx","file3.xlsx"]
merger.merge_csv(fileList,path)
Note
The invalid_files are skipped and if only file is passed in the fileList, the output will be same.
Supported File Types
PyConju supports .xls, .xlsx and .csv for now. Check for future releases…
Dependency
PyConju depends heavily on pandas, do well to check pandas Documentation.
Tracking Bugs
If you run into issues, do well to visit the Contributing to pyconju section for more details.
If you have already read the guidlines, log the issue directly on the github repo.