From ade9c88af0859ef02b58354c12946eefaa38f3c1 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 10 Feb 2022 18:59:10 -0500 Subject: [PATCH] add docs --- README.rst | 17 +++++++++++++++++ xlsx_dir_map/__main__.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 630b79b..76f656f 100644 --- a/README.rst +++ b/README.rst @@ -5,3 +5,20 @@ A CLI for creating on-disk directory hierarchies based on Excel columns ------------------------------------------------------------------------- +Usage: + +``` +# Subdirectory groupings +poetry run python xlsx_dir_map -i "Folder Name List.xlsx" -o "output_subdirs" -r "A2:D340" A B C D + +# Flat directory groupings +poetry run python xlsx_dir_map -i "Folder Name List.xlsx" -o "output_flatdirs" -r "A2:D340" A:B:C:D +``` + +The command above specifies the name of an input spreadsheet (`-i`), the root of the outputs (`-o`), +and a range of spreadsheet cells to parse (`-r`). Then, the CLI accepts an arbitrary number of column +group arguments. + +The column group arguments specify subdirectory grouping structures. Column names separated by a space +will create an additional nested directory `/output/.../A/B` whereas column names separated by a colon +will create a directory whose name contains the values of both columns, i.e `/output/.../A B`. diff --git a/xlsx_dir_map/__main__.py b/xlsx_dir_map/__main__.py index dae6747..43f94ba 100644 --- a/xlsx_dir_map/__main__.py +++ b/xlsx_dir_map/__main__.py @@ -1,6 +1,6 @@ import argparse -parser = argparse.ArgumentParser(description='Process some intzzz') +parser = argparse.ArgumentParser(description='Convert spreadsheet data into named directories') parser.add_argument('--in', '-i', dest='file_in', required=True) parser.add_argument('--out', '-o') parser.add_argument('--range', '-r', dest='cell_range')