Package: tagnote
InstallationIf installing from PyPI:$ pip3 install tagnoteIf installing from source:$ python3 setup.py sdist
$ pip3 install -U dist/tagnote-$VERSION.$FORMATTo create and edit notes, Tagnote needs a text editor with an appropriate plugin. Currently, Tagnote only supportsvim, so you will need to make sure thatvimis installed.To install thevimplugin, see therepositoryfor instructions.For synchronizing notes, Tagnote requires thersynccommand. Installrsyncif you need to synchronize notes.IntroductionThe first problem with note-taking software is you might not realize it’s a note until after it’s been written.Normally, notes like this would exist as a collection of text files with gibberish names in several unrelated directories. Tagnote allows you to do this::W
"~/notes/2018-07-11_19-37-44.txt" [New] *L, *C writtenThere’s no need to think of a name right now, and Tagnote preserves the most important metadata, the creation date, for you. There’s no need to open up a separate note application, copy and paste the contents of the note, and then put the note in the right place. Tagnote is for when you want to get your idea out first and organize it later.Working with LabelsIf, after the fact, you wish to add a label, you can do this::A groceriesThe Tagnote command can also do this if you know the name of the note:$ tag add 2018-07-11_19-37-44.txt groceriesYou can then open the note afterwards by label:$ tag last groceriesThis opens the note in a text editor. If you make changes to the note, you can either save them normally or create a copy of the note::W
"~/notes/2018-07-11_19-45-04.txt" [New] *L, *C writtenThis command remembers the current note’s labels and applies them to the copy. When you runtag last groceriesagain, Tagnote displays the most recent note,2018-07-11_19-45-04.txt.You can also edit the previous note:$ tag -r 1: last groceriesThis passes the-rflag, which filters out the latest note using the slice1:.Instead of switching between these two notes manually, you can see their changes by running a diff on them:$ tag last -d groceriesThis opens up a diff editor with the changes highlighted.Summary CommandsYou can see all members of thegrocerieslabel:$ tag members groceriesThis lists all members ofgroceriesin sorted order. Sorting puts the notes in chronological order because of the way Tagnote names notes.This is handy for reporting:$ tag show groceries | lessThis prints out the content of the notes as well as a formatted header and footer around each note. This is great for getting a summary of the material in each label. By default,showputs notes in reverse chronological order.You can also get a forward chronological account:$ tag -o a show groceries | lessThe-oflag takes theaargument which is short for “ascending.”You can confirm that a note is in fact a member of a label:$ tag categories 2018-07-11_19-45-04.txtThis prints the labels the note is a part of, in this casegroceries.You can also list all top-level tags:$ tag membersYou’ll notice that this only includesgroceriesand not the two notes. This is because thememberscommand only lists immediate children, and sincegroceriesis now the parent of the two notes, those two notes are not members of the top level.Theshowcommand works differently:$ tag show | lessThis lists all notes in reverse chronological order, even if they are children of another label.showcan also show notes from several labels::A foods

$ tag show groceries foodsEven if a note is a member of several labels,showshows each note only once.Important FiltersYou can also ask Tagnote to search for text inside notes directly:$ tag -s lentils -s kale show | lessThis only shows notes that have both the textlentilsand the textkalein them.Similarly, you can search by date range:$ tag -t 2018-07-11_19-40: -t 2005-*-29:2007 showThis shows notes created at 7:40 PM on July 11th, 2018 or later or notes created in 2005, 2006, or 2007 on the 29th, 30th, or 31st of each month, which means the command only includes the2018-07-11_19-45-04.txtnote.Dealing with RemotesYou can back up your notes to another location:$ tag push michael@my-server:notesThis copies the directory containing your notes, by default~/notes, to the remote location. The remote location can be anythingrsyncaccepts as a destination. Unlike inrsync, the name you pass in the command is always the name of the immediate directory containing the notes. In this example, even if there is no trailing slash, the destination directory is nevernotes/notes.To change the directory Tagnote stores your notes, see theConfigurationsection below. This doesn’t move notes that already exist; usetag pushto copy them over before changing the directory.When synchronizing between several copies of the notes, sometimes you need to copy a remote source into your notes directory:$ tag pull michael@my-server:notesThis works the same way astag pushexcept in the opposite direction.When there are conflicts,tag pushandtag pullcreate backup files like2018-07-11_19-45-04.txt.2018-07-11_21-10-24.bak. Tagnote indicates the conflicted file and adds the timestamp when you rantag pushortag pullas well as the.bakextension. The new version exists as2018-07-11_19-45-04.txt, and the old version is the backup file named above.If you want to accept all changes after apushor apull, simply delete all.bakfiles:$ find ~/notes -name '*.bak' -deleteIf there are changes you would like to keep, Tagnote provides a wizard to incorporate changes from.bakfiles:$ tag reconcileThis prints the conflicted file and the timestamp of the backup file and then prompts for an action. You can run the diff editor to reconcile changes by choosing theeditaction. If you close the diff editor and the conflicted file and its backup are the same,reconciledeletes the backup file. To go to the next backup file, choose thenextaction. To go to the next conflicted file, chooseskip.quitexits thereconcilecommand at any point.In addition to.bakfiles, the editor might generate other files, such as.swpfiles, that the editor must resolve manually. To list all files that Tagnote doesn’t recognize, run:$ tag unknownThis prints out all such files.Note LifecycleYou can import a pre-existing file as a note:$ tag import asdlfkjfs.txtThis uses the modification time for the name of the note.You can also remove tags and associations between tags:$ tag remove 2018-07-11_19-45-04.txt groceries
$ tag remove 2018-07-11_19-45-04.txtYou must remove all associations for a tag before removing the tag itself.ConfigurationTagnote uses a configuration file for various options. By default, the configuration file exists at~/.tag.config.json. You can change this by passing a different value to the-cflag on the command line:tag -c ~/other-tag.config.json ...The configuration file is a JSON object that maps string configuration options to configuration values.By default, the notes directory is at~/notes. To change the notes directory, use thenotes_directoryoption:{
...
"notes_directory": "Documents/notes",
...
}Note that the value ofnotes_directoryis relative to the home directory.By default, the editor isvimwith no arguments. To change the editor, use theeditoroption:{
...
"editor": ["vim", "-n"],
...
}You can also set the editor using environment variables. In order, Tagnote prioritizesTAGNOTE_EDITOR, thenVISUAL, and thenEDITOR. You cannot pass editor command arguments using environment variables, and the value in the configuration file takes priority over the environment variables.Similarly, the default diff editor isvimdiffwith no arguments. To change the editor, use thediffoption:{
...
"diff": ["meld"],
...
}You can also set the diff editor using theTAGNOTE_DIFFenvironment variable. You cannot pass diff editor command arguments using environment variables, and the value in the configuration file takes priority over the environment variable.By default, the rsync program isrsync. To change the rsync command, use thersyncoption:{
...
"rsync": ["/usr/local/bin/rsync"],
...
}TheTAGNOTE_RSYNCenvironment variable also sets the rsync command and is lower priority than the value in the configuration file.By default, notes use local time for timestamps. To use UTC, update the config file:{
...
"utc": true,
...
}