pathsummary.PathSummary.from_file_paths

static PathSummary.from_file_paths(file_paths: List[pathlib.Path]) pathsummary.PathSummary

Creates a path summary based on the given file paths.

Parameters

file_paths – File paths of the path summary.

Returns

PathSummary

Examples

>>> from pathsummary import summarize_folder_files
>>> from doctestprinter import print_pandas
>>> from pathlib import Path
>>> test_file_paths = [
...     Path("tests/resources/images/image01.BMP"),
...     Path("tests/resources/images/image00.jpeg"),
...     Path("tests/resources/images/image00.jpg"),
...     Path("tests/resources/images/image01.JPEG"),
...     Path("tests/resources/images/image01.JPG"),
... ]
>>> sample_summary = PathSummary.from_file_paths(test_file_paths)
>>> print_pandas(sample_summary.table)
                            file_rootpath      filename  encoding
filetype  subtype
   image      bmp  tests/resources/images   image01.BMP      None
             jpeg  tests/resources/images  image00.jpeg      None
             jpeg  tests/resources/images   image00.jpg      None
             jpeg  tests/resources/images  image01.JPEG      None
             jpeg  tests/resources/images   image01.JPG      None
>>> test_file_paths = [
...     Path("tests/resources/images/image01.BMP"),
... ]
>>> sample_summary = PathSummary.from_file_paths(test_file_paths)
>>> print_pandas(sample_summary.table)
                            file_rootpath     filename  encoding
filetype  subtype
   image      bmp  tests/resources/images  image01.BMP      None