Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alex-ber/AlexBerUtils/llms.txt

Use this file to discover all available pages before exploring further.

The files module provides utilities for working with the filesystem.

join_files

Concatenates a set of numbered partial files into a single output file. The function scans the same directory as the output file for files whose name follows the pattern <stem>_*<suffix> and appends each one to the output file in glob order.
from alexber.utils.files import join_files

# Given: output_part_1.txt, output_part_2.txt, output_part_3.txt
join_files('output.txt')
# Produces: output.txt  (contents of all three parts concatenated)
Typical use case — reassembling a file that was split across multiple worker processes:
import pathlib
from alexber.utils.files import join_files

output_path = pathlib.Path('/data/results.csv')
join_files(output_path)
f
str | Path
required
Path to the output file. This path is also used as the glob pattern base: all files in the same directory whose names match <stem>_*<suffix> are read and written into this file.
Returns: None. The output file is written (or overwritten) in place.
The output file is opened in write mode ('w'), which will overwrite any existing content. The partial files (<stem>_*<suffix>) are read but not deleted.