Tarotfs is a program I wrote on 9front for the plan9 family of operating systems as part of my effort to use plan9 as an "occult research OS". It has been a great way of exploring the 9p protocol on which plan9 builds the paradigm "everything is a file" and also exploring the use of namespaces in the OS.
It's additionally been a useful tool for me to begin to learn more about tarot, as I started to get really sick of having to turn to the internet to look up definitions, so I added in support for being able to populate a definitions directory with information on the cards (keywords, definitions and in the future also images).
Finally it enables other programs to be built upon it, allowing them to use the spreads as an interstitial random number generation or essentially anything that the user can think of as part of their magical operation!
Source for tarotfs is available to be git cloned directly from
(web) https://git.sr.ht/~grimmware/tarotfs
The man page is below:
TAROT(4) TAROT(4) NAME tarot - tarot card filesystem SYNOPSIS tarot [ -DdkPh ] [ -p definitions ] [ -m mtpt ] DESCRIPTION Tarotfs presents a file system interface to generating and interacting with tarot spreads. Tarotfs mounts itself at mtpt (default /mnt/tarot). The -D flag enables 9P debug prints and -h displays the short list of options. Tarotfs also optionally supports displaying keywords and definitions when reading files for the drawn cards by pro- viding a definitions directory with the flag -p wherein the directory structure should follow the structure: Name/Suit/Card/ and contain the files keywords and description, both of which can be freeform text files. The keywords should ideally contain a short list of keywords to associate with both the upright and reversed configuration of each file. The Name/Suit/Card naming convention has the following restrictions: Name This can be any directory name, and isn't actually uti- lized (yet). Currently tarotfs will just pick the first named pack inside the supplied definitions direc- tory. Suit There must be definitions for all of Cups,Pentacles,Swords,Wands,Major the last of which must obviously be populated with the Major Arcana. Card For the minor arcana these will be the capitalised form of the card's name or number, for example Eight,Ace,King. For the major arcana, it must be the full name of the card (with spaces) e.g. TheMagician,Strength,WheelofFortune. This is a little more hairy, so read the code if you're unsure. The flags -dkP enable displaying the definitions, keywords and definition paths when reading the card files respec- tively when -p is supplied. The top level contains the file clone, and the directory card_library, the latter of which contains a tree of all the available cards. Reading or writing to the clone file creates a new numbered subdirectory for a new tarot spread and redirects the opera- tion to the ctl file at the top of the directory. Each "spread" directory contains the files: ctl, draw and remaining. The ctl file is used to control the various settings for the spread by writing commands and arguments to the file: spread Sets the names for the drawn cards in addition to their numbers. Arguments are space separated. keywords Toggles whether keywords are displayed when reading card files descriptions Toggles whether descriptions are displayed when reading card files paths Toggles whether definition paths are displayed when reading card files Reading the ctl file will return the spread number (matching the spread's directory) on the first line. If a deck defini- tion was supplied, it will also print on the following lines the attributes deckpath,keywords,description each followed by a space and then the path of the deck definition and the booleans for whether keywords and descriptions are enabled for the spread respectively. EXAMPLE The following shows a simple example of cloning a new spread, setting the spread name and then drawing all the cards from the spread. † tarot † ls /mnt/tarot /mnt/tarot/card_library /mnt/tarot/clone † cat /mnt/tarot/clone 1 † cd /mnt/tarot/1 † ls ctl draw remaining † echo spread past present future advice > ctl † for(i in `{seq 1 4}) cat draw Four of Pentacles upright Ⅱ: The High Priestess reversed King of Wands upright Seven of Cups reversed † ls 1:past 2:present 3:future 4:advice ctl draw remaining † cat remaining 74 SOURCE https://git.sr.ht/~grimmware/tarotfs