Runnable modules

The basic functionalities of the library are provided as runnable modules. This allows to quickly perform analysis on-the-spot without the need of writing code.

pathtreelib runnnable

Runnable module for pathtreelib.

pathtreelib.__main__.main()

Compute the tree on specified directory. The creation of the tree automatically computes the basic properties on all nodes. The properties compued on the root, that are valuable information to understand the structure of the tree, are printed (with exclusion of depth and height that would be less useful). The nodes of the computed tree can be exported in csv and Excel.

It is possible to pass the following parameters:

  • -d, –dir: the directory to analyse

  • -n, –n: the number of nodes to export (see node_limit in to_csv and in to_excel)

  • -x, –excel: the Excel file for export (only if specified)

  • -c, –csv: the csv file for export (only if specified)

Examples:

>>> python -m pathtreelib -d . -n 1000 -x test.xlsx -c test.csv
    <num_dir>     >     218
    <num_file>    >     421
    <num_inode>   >     209
    <num_leaves>  >     430
    <num_nodes>   >     639
    <size>        > 8135024
    <simple_size> >    7 MB

pathtreelib.analytics runnnable

Runnable module for pathtreelib.analytics.

pathtreelib.analytics.__main__.main()

Run a basic analysis on the specified directory. The analysis consist in computing the largest nodes in the tree, with respect to their size. To avoid redundancy, in the extracted nodes there is no pair of nodes where one node is the ancestor of the other. The results of the test are printed and the list of extracted large nodes can be exported in csv and Excel.

It is possible to pass the following parameters:

  • -d, –dir: the directory to analyse

  • -k, –k: the number of large nodes requested

  • -x, –excel: the Excel file for export (only if specified)

  • -c, –csv: The csv file for export (only if specified)

Examples:

>>> python -m pathtreelib.analytics -d . -k 3 -x test.xlsx -c test.csv
    gordon/pictures/equipment      >   3 GB
    gordon/black mesa/research.pdf >  15 MB
    gordon/black mesa/xen.txt      >   6 MB