Skip to main content

Simple command-line file tagger

Project description

Preface

Most of this project was created before I began using GitHub, which is why the first commit is already almost finished.

Most error handling should be done now. I am now working on ironing out a few bugs.

This is just a personal project that I will use for college. The goal is not for it to be perfect, but for it to work.

Any criticism is welcome — especially about my code. It is also worth noting that this is the first documentation I've written, so I apologise if it's not up to your expected standard. Please also tell me how I can improve the docs. Thank you.

This programme has only been tested on Linux. Due to its use of the 'os' module and extended attributes, it may not work on all operating systems.

What Is This Project?

This project is a very simple command-line file tagger. Its main function is to tag files and folders to make organisiation easier. I wrote this programme, as I am going to start college soon, and I wanted a simple way to organise my notes. It is just a personal project. Below is an outline of the features:

  • Tagging files and folders. The 'os' module is used to tag items using extended attributes. Command: at

  • Removing tags from files and folders. Command: rt

  • Searching for items in a directory with a given tag. Command: gi

  • Getting the tags of an item. Command: gt

  • Listing all items in a given directory, along with their tags. Command: li

  • Creating and removing aliases for commands. Commands: ca, ra

  • Listing all aliases. Command: la

  • Recursively adding tags to or removing tags from items to a certain depth. Commands: rc, rr

  • Resetting all dotfiles in ~/.fmdata (aliases, lookup tables, etc). Command: rd

  • Undo. Undo the previous undoable command, up to five commands ago.

Help

Here is the output of running the command with the --help flag:

|   Name   |                   Description                    |           Usage               |
|---------------------------------------------------------------------------------------------|
|    at    |    adds a tag to a file or folder                |    at <path> <tag>            |
|    rt    |    removes a tag from file or folder             |    rt <path> <tag>            |
|    gi    |    searches items by tag                         |    gi <path> <tag>            |
|    gt    |    displays tags of a file or folder             |    gt <path>                  |
|    li    |    lists files and folders and their tags        |    li <path>                  |
|    rc    |    tags all items in a directory                 |    rc <path> <tag> <depth>    |
|    rr    |    removes a tag from all items in a directory   |    rr <path> <tag> <depth>    |
|    ca    |    creates an alias for a command                |    ca <command> <alias>       |
|    ra    |    removes an alias                              |    ra <alias>                 |
|    la    |    lists all existing aliases                    |    la                         |
|    rd    |    resets all alias data                         |    rd                         |

Installation and Uninstallation

To install

pip install ftagger

OR

pipx install ftagger

To uninstall (one extra step)

pip uninstall ftagger

OR

pipx uninstall ftagger

After running that, you will then need to remove the dotfiles located at ~/.fmdata. You may run:

rm -rf ~/.fmdata

Usage

After installation, you should be able to run the programme from a terminal. Here is an example of what that may look like:

ftagger at file1.txt tag

Here is a breakdown of that example command: ftagger — the command used to invoke this programme. It is like cd, ls, cat, etc at — the 'add tag' command file1.txt — the target. This can be a file or a folder tag — the tag to add to the target

To get help about the usage of the commands, run the following command:

ftagger --help

This will print out the table seen under the 'Help' heading.

Requierments

Python 3.10 and above

The project has only been tested on Linux

Issues

If you edit any dotfiles in ~/.fmdata manually, make sure you understand how to edit the others accordingly.

If there are any errors that mention broken dotfiles, use the 'rd' command to reset all of the dotfiles. If that doesn't fix the issue, please open an issue on the GitHub repo.

If the programme crashes for any reason (you recieve a full Python error), please open an issue on the GitHub repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftagger-0.2.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ftagger-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file ftagger-0.2.1.tar.gz.

File metadata

  • Download URL: ftagger-0.2.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for ftagger-0.2.1.tar.gz
Algorithm Hash digest
SHA256 404f3ac029c8919d929197666be65f14ab5c960b77402b0b44529f4a8c033d5c
MD5 790b3946bb5fcaa5ce947d68cbf909f3
BLAKE2b-256 22138576d35740d51206b9c495aae7eb0365f2779ad3b8a59cf5d5ce804ea53b

See more details on using hashes here.

File details

Details for the file ftagger-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ftagger-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for ftagger-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38fe96944f1c04280c941311c318060857cfe3b6f07f43f7e0ba1f73c5714a52
MD5 3d002fa2b801b8d8247597f4f31abf2d
BLAKE2b-256 e13aecdf4c9c4af41e0d74aba3a2d8461a04c78683296a2b44b25ff01c1b62b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page