Skip to main content

๐Ÿ“ File API Reference

Sub-package: pofile | Install: pip install pofile Import: import office or import pofile

Function Overviewโ€‹

FunctionDescription
replace4filename(path, del_content, replace_content)Batch replace & rename
file_name_insert_content(file_path, insert_position, insert_content)Insert in the middle
file_name_add_prefix(file_path, prefix_content)Add prefix
file_name_add_postfix(file_path, postfix_content)Add suffix
output_file_list_to_excel(dir_path)File names โ†’ Excel
search_specify_type_file(file_path, file_type)Search by file type
get_files(path, name, suffix, sub, level)Search and return list
add_line_by_type(add_line_dict, file_path)Add line by type
group_by_name(path, output_path, del_old_file)Group by name

Examplesโ€‹

import office

office.file.replace4filename(
path='./photos/', del_content='IMG_', replace_content='travel_'
)

office.file.file_name_add_prefix(file_path='./docs/', prefix_content='2026_')

files = office.file.get_files(path='./', suffix='.xlsx', sub=True)
AI ๅŠžๅ…ฌๆ•ˆ็އ่ฏพ
35 ่ฎฒ AI ่‡ชๅŠจๅŒ–ๅŠžๅ…ฌๅฎžๆˆ˜่ฏพ็”จ Python + AI ๅค„็† Excelใ€Wordใ€PDFใ€้‚ฎไปถ็ญ‰ๅŠžๅ…ฌๅœบๆ™ฏใ€‚
ๅŽปๅญฆไน