pathsummary.PathSummary.summarize_path

static PathSummary.summarize_path(folder_path: Union[str, pathlib.Path]) pathsummary.PathSummary

Summarizes the content of the given folder path.

Parameters

folder_path – The folder path which content is summarized.

Returns

PathSummary

Examples

>>> from pathsummary import PathSummary
>>> from doctestprinter import print_pandas
>>> from pathlib import Path
>>> test_path = "tests/resources/images"
>>> sample_summary = PathSummary.summarize_path(test_path)
>>> print_pandas(sample_summary.table)
                            file_rootpath      filename  encoding
filetype  subtype
   image      bmp  tests/resources/images   image00.bmp      None
              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
              png  tests/resources/images   image00.png      None
              png  tests/resources/images   image01.PNG      None
             tiff  tests/resources/images   image00.tif      None
             tiff  tests/resources/images  image00.tiff      None
             tiff  tests/resources/images   image01.TIF      None
             tiff  tests/resources/images  image01.TIFF      None