This is code for playing tarot cards. Each card has a rich set of properties and there are many helpers to assist with associating cards with common symbols or esoteric references. The cards have been scored for positivity and emotions.
Project description
tarot_cards
This is a python repository with some code that has a lot of properties for each card so its easy to find associations in readings. https://github.com/ddtraveller/tarot_cards
Basic Usage
# spin up the object
from tarot import TarotCards, Card
t = TarotCards()
# get a random card
card_obj, raw_card_name = t.rnd_card(played_cards=[])
# there are a number of properties for major and minor arcana cards
# ex: 'astrology', 'card_name', 'card_sephira', 'card_text', 'card_type', 'card_url', 'emotional_score', 'h_letter', 'h_number', 'h_origin', 'h_text', 'neg', 'neu', 'pos', 'tree_location', 'tree_num', 'world'
# print out the card name and a description of the card
print(f'{card_obj.card_name}.title()' is your first card. {{card_obj.card_text})
The properties relate to astrology, kabbalah, hebrew letters, emotions and location on the tree of life. Emotion scores look something like this;
emotional_score={'Calm': 0.20, 'Mystical': 0.23, 'Overwhelmed': 0.00, 'Curious': 0.30, 'Happy': 0.22, 'Angry': 0.0, 'Surprised': 0.44, 'Sad': 0.22, 'Fearful': 0.11}, pos='0.749', neu='0.135', neg='0.067',
The pos, neg, neu values were derived using AWS comprehension. The emotions were done with another lib but that one was terrible so I re did them by hand.
Get 6 cards but don't include the fool or magician cards and then count the number of cards that include an angel or a crown and then print the description of the crown if it exists.
cards = t.rnd_card_list(6, played_cards=['fool', 'magician'])
for card, c_obj in cards.items():
if card in t.angels:
t.angels_count += 1
if card in t.crowns:
t.crowns_count += 1
print(f'This is a description of the crown in the card: {t.crowns_desc_dict[card]}')
Get the main emotion of a card;
emotions = card_obj.emotional_score
max_emotion = max(zip(emotions.values(), emotions.keys()))[1]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tarotNLP-0.1.0.tar.gz.
File metadata
- Download URL: tarotNLP-0.1.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e0dcb7f471a582dae36ad089780e74d8dccbc19eb8467dead17672b4c27223f
|
|
| MD5 |
8c5952bbb7fec4374fd8f07322e6a6d5
|
|
| BLAKE2b-256 |
3f3535bfeb36617cc8367c7b421c6f5e96a95cc4cb18a05703044ef9c093732c
|