Automate repetitive file tasks — batch imports, directory documentation, and document conversion.
Functions
ImportDataFromFolder
Load and combine all CSV or Excel files in a directory into a single DataFrame.
from analysistoolbox.file_management import ImportDataFromFolder
df = ImportDataFromFolder(
folder_path="data/monthly_reports/",
file_type="csv"
)
CreateFileTree
Generate a tree diagram of a directory structure — useful for documentation.
from analysistoolbox.file_management import CreateFileTree
CreateFileTree(directory_path="./project/", output_file="structure.txt")
CreateCopyOfPDF
Copy specific page ranges from a PDF into a new file.
ConvertWordDocsToPDF
Batch convert all .docx files in a folder to PDF (requires Microsoft Word on Windows/macOS).
Use cases
- Combining monthly report exports into one analysis DataFrame
- Documenting project directory structures
- Archiving specific pages from large report PDFs