Ruby Tarot
These scripts will select 3 tarot cards representing your past, present and future. It prints a summary to the command line, and creates a PDF file named tarot_[timestamp].pdf with pictures of the cards and their alleged meanings.
It currently only selects cards from the major arcana because I gathering images and interpretations for the other 56 cards in the minor arcana was not a data-entry project I felt like taking on.
Brief Use Instructions
ruby ruby_tarot.rb
Requires
- Ruby
- Ruby Gems
- Ruby Gem Prawn
Installation
- Unpack the file you downloaded, ruby_tarot.tar.bz2, with the following commands:
bunzip2 ruby_tarot.tar.bz2
tar xvf ruby_tarot.tar
This will delete the file ruby_tarot.tar.bz2 while creating the file ruby_tarot.tar and a directory called ruby_tarot
To Use
- In a terminal, navigate to ruby_tarot (the directory created when you extracted the file).
- Type:
ruby ruby_tarot.rb
This will output 3 lines indicating what 3 cards it selected. For example:Card #0 is #10: The Wheel Of Fortune: chance or luck.
Card #1 is #7: The Chariot: transition; moving from one place or another.
Card #2 is #11: Death: a new beginning.
It will also create a PDF in the same directory. It will be titled something like tarot_0123456789.pdf where the string of numbers represents the current Unix timestamp.
Additional Resources
- Screenshot of command line output
- Download the sample PDF
- Screenshot of what a PDF may look like
- Ruby Tarot on Source Forge
Known Issues
As it comes, Ruby Tarot can't be run from any other directory because of problems with include paths.
Potential Improvements
- I put a page break between each card because I am threatening to fill out the meanings associated with each card, but at the moment it just has sentence fragments for meanings. The resulting PDF looks kind of silly.
- I started writing the code to generate the minor arcana before realizing that was too much data entry. I commented out the code, but left it intact. I should remove it or fill it out.
- Use language files instead of hard-coding all the strings.
- Write up instructions for how the user can easily substitute other images for cards. There are zillions of tarot card decks, and some users might want to use their favorite deck, rather than the one that's in public domain.
- I avoided using a database to define the various cards because I wanted to keep it a no-install script. I like databases though, so I'll probably build one in eventually.

The Fine Print:
- The code is released under the GPLv3.
- I don't take tarot cards seriously. I think it's a fun parlor game like spirit boards or making a quarter appear from somebody's ear. I hope I have not offended anyone who does take tarot cards seriously. I don't think this script has any mystical insights or knows the future. In any event, the resulting PDFs are strictly for entertainment purposes.
- The images included are from the popular tarot deck, the Rider Waite. The artwork is now public domain in the US. Rather than scan a deck, I downloaded the images come from Wikipedia. Please see their Public Domain reference page to ascertain their legality in other countries.
- I didn't want to hunt around for a free/Creative-Commons treatise on the cards' meanings with a license that would let me duplicate it, so I made up my own. I did not consult books or the internet, I completely fabricated it. Some of it may be the same as you find in tarot books, but that's purely coincidental.
