Package: hew-tag
TagA command line interface to manage file name tags.UsageInstall from PyPIpip install hew-tagRun Locallypython -m tagInstall LocallyTo install in "editable" mode:pip install -e .
tagDescriptionThere is nothing special about file tags. They are just text inside the
filename. You can add or remove them any way you would normally rename a
file. This tool just makes it a little easier to do things in bulk.I have arbitrarily chosen to start tags with an open curly{and
close tags with a close curly}. I thought this was easier to read than some
other options (including the popular web "hash tag" format).The main feature oftagis to index files by tag. For example, if you keep
all files for the same year in the same folder, it can be a little challenging
to find related files (taxes, car maintenance, etc.).tag indexcreates a
directory tree of tags with smylinks to all the tagged documents. This makes it
easy to find all files tagged withtaxes-2020when tax time comes around.For example:~/Documents/
├── 2020/
│   ├── 2020-09-01 Car Service {toyota-yaris}.pdf
│   ├── 2020-10-01 Charitable Receipt {taxes-2020}.pdf
│   └── ...
└── 2021/
    ├── 2021-01-15 Work W-2 {taxes-2020}.pdf
    ├── 2021-03-01 Car Service {toyota-yaris}.pdf
    └── ...Running:tag index ~/Documents ~/TagsWill produce symlinks like:~/Tags/
├── taxes-2020/
│   ├── 2020-10-01 Charitable Receipt {taxes-2020}.pdf -> ~/Documents/2020/2020-10-01 Charitable Receipt {taxes-2020}.pdf
│   └── 2021-01-15 Work W-2 {taxes-2020}.pdf -> ~/Documents/2021/2021-01-15 Work W-2 {taxes-2020}.pdf
└── toyota-yaris/
    ├── 2020-09-01 Car Service {toyota-yaris}.pdf -> ~Documents/2020/2020-09-01 Car Service {toyota-yaris}.pdf
    └── 2021-03-01 Car Service {toyota-yaris}.pdf -> ~Documents/2021/2021-09-01 Car Service {toyota-yaris}.pdfCookbookRename all tags in a directory recursivelySuppose I name my Toyota Yaris "Harold" and want to rename all my tags. I can
usetag findto list all uses of thetoyota-yaristag and then usetag renamewithxargsto rename the tag toharold. Using the-0arg for
bothtag findandxargsassures any whitespace in file names won't affect the command.tag find -r0 toyota-yaris ~/Documents | xargs -0 tag rename toyota-yaris haroldUsageSynopsisUsage: tag [OPTIONS] COMMAND [ARGS]...

  tag - manage file name tags

  File tags:
    - are in the file name matching: {[a-zA-Z0-9-]+}
    - start with '{' and end with '}'
    - consist of letters, numbers and the '-' character

  Examples:
    - myfile{my-tag-1}{my-tag-2}.txt
    - My Title Case File {My-Tag-1}{My-Tag-2}.txt

Options:
  --version  Show version information.
  --help     Show this message and exit.

Commands:
  add      Add tags to files.
  clear    Clear tags from files.
  find     Find files by tag.
  index    Index tagged files.
  list     List tags on files.
  remove   Remove tags from files.
  rename   Rename a tag on files.
  set      Set tags on files.
  sort     Sort tags on files.
  version  Show version information.AddUsage: tag add [OPTIONS] TAGS [FILES]...

  Add tags to files.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag add my-tag myfile.txt
    - tag add my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.ClearUsage: tag clear [OPTIONS] [FILES]...

  Clear tags from files.

  FILES list of files

  Examples:
    - tag clear myfile{my-tag}.txt
    - tag clear *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.FindUsage: tag find [OPTIONS] TAG [PATH]

  Find files by tag.

  TAG  tag to find
  PATH path to search (default .)

  Examples:
    - tag find -r my-tag path/to/files/
    - tag find my-tag

Options:
  -a, --all        Include hidden files.
  -0, --null       End output lines with NULL (\0) instead of newline.
  -r, --recursive  Include subdirectories recursively.
  -t, --tree       Show output as tree.
  --help           Show this message and exit.IndexUsage: tag index [OPTIONS] PATH OUTPUT

  Index tagged files.

  PATH   path to search
  OUTPUT path to new index

  Examples:
    - tag index my-files my-index
    - tag index -r my-files my-index

Options:
  -a, --all        Include hidden files.
  -d, --debug      Make no changes to the file system.
  -r, --recursive  Include subdirectories recursively.
  -t, --tree       Create index with nested tag tree.
  -v, --verbose    Show additional output.
  --help           Show this message and exit.ListUsage: tag list [OPTIONS] [PATH]

  List tags on files.

  PATH path to search (default .)

  Examples:
    - tag list -r path/to/files/
    - tag list

Options:
  -a, --all        Include hidden files.
  -c, --count      Show count of matches.
  -0, --null       End output lines with NULL (\0) instead of newline.
  -r, --recursive  Include subdirectories recursively.
  --help           Show this message and exit.RemoveUsage: tag remove [OPTIONS] TAGS [FILES]...

  Remove tags from files.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag remove my-tag myfile{my-tag}.txt
    - tag remove my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.RenameUsage: tag rename [OPTIONS] OLD_TAG NEW_TAG [FILES]...

  Rename a tag on files.

  OLD_TAG current tag name
  NEW_TAG new tag name
  FILES list of files

  Examples:
    - tag rename my-tag my-new-tag myfile{my-tag}.txt
    - tag rename my-tag my-new-tag *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.SetUsage: tag set [OPTIONS] TAGS [FILES]...

  Set tags on files.

  Add and remove tags to ensure each file has the supplied tags and only the
  supplied tags.

  TAGS  comma seperated list of tags
  FILES list of files

  Examples:
    - tag set my-tag myfile{my-tag}.txt
    - tag set my-tag-1,my-tag-2 *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.SortUsage: tag sort [OPTIONS] [FILES]...

  Sort tags on files.

  FILES list of files

  Examples:
    - tag sort myfile{my-tag-2}{my-tag-1}.txt
    - tag sort *.txt

Options:
  -v, --verbose  Show additional output.
  -d, --debug    Make no changes to the file system.
  --help         Show this message and exit.VersionUsage: tag version [OPTIONS]

  Show version information.

  Examples:
    - tag version

Options:
  --help  Show this message and exit.