Skip to content

howlCode/tarot_api

Repository files navigation

Tarot API

An API for interacting with a deck of tarot cards. Cards can be "drawn" one by one, shuffled, and in a few various spreads(celtic cross, three card, etc). Images are from the Rider-Waite tarot deck and they are public domain. The information on the cards has been pulled from https://www.simplytarot.com

How can I use it?

You may draw cards from the API using these unique endpoints:

URL: https://localhost:3000/api/v1

Draw all the cards in order

 /cards

Draws ALL cards randomly shuffled

/spreads/shuffled

Draws one random card

/spreads/random_card

Draws three random cards

/spreads/three_cards

Draws 10 random cards

/spreads/celtic_cross

Each card has unique information which you can grab using the identifiers of the object:

an image of the card face

image

The card's name

name

A summary of the card's meaning

summary

A more verbose description of what the card means

full_meaning

When the card is upright, these are the keywords it can mean

upright

When the card is reverse, these are the keywords applicable to its meaning

reversed

Installing/Running

clone repo
bundle install
yarn install
./bin/rails db:create
./bin/rails db:migrate
./bin/rails read_cards:load_cards
./bin/dev
API available at localhost:3000/api/v1
simple index view (images) of all cards at root

Happy trails!

Copyright 2024 howlCode

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

rails API for rider-waite tarot and spreads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published