Skip to content

Commit

Permalink
Merge pull request #21 from beeankha/misc_updates
Browse files Browse the repository at this point in the history
Misc. Cleanup
  • Loading branch information
beeankha authored Dec 1, 2022
2 parents 814897b + f4da224 commit faf0157
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 71 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/learn-github-actions.yml

This file was deleted.

9 changes: 3 additions & 6 deletions cli_tarot/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Command Line Tarot

This project is meant to be a ~~nerdy~~ convenient way to get a tarot reading via the command line interface!

---
This is version `1.0.3` of the Command Line Tarot CLI tool.

# 🚧 This Package is Under Construction 🚧

This is a beta/test version `0.1.3` of the Command Line Tarot CLI tool!
This project is meant to be a ~~nerdy~~ convenient way to get a tarot reading via the command line interface!

Currently missing most card interpretations. However, the ASCII art is fully accessible and complete.

---


## Instructions for Installing from PyPI

Create and activate a virtual environment or a `conda` env that has Python 3.9, then run the following:
Expand Down
113 changes: 76 additions & 37 deletions cli_tarot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def main():

parser.add_argument("-o", "--output",
default=False,
help="Directs the output to a text file stamped with current datetime.",
help="""
Directs the output to a text file stamped with reading type
and current datetime.
""",
action='store_true',
)

Expand All @@ -62,7 +65,7 @@ def main():
help="""
'Free Draw'\n
Read a specific number of cards
(passed as an integer after the '-fd'
(passed as an integer after the '-f'
flag; defaults to a single-card pull)
""",
# required=False,
Expand All @@ -83,25 +86,25 @@ def main():
required=False,
)

group.add_argument("-cc", "--celtic_cross",
help="""
'Celtic Cross'\n
A 10-card spread which reveals:
Card 1 - The present condition of the querent
Card 2 - Immediate influence / obstacles
Card 3 - Goal / destiny according to existing circumstances
Card 4 - Distant past foundation
Card 5 - Recent past events
Card 6 - Future influence
Card 7 - The questioner
Card 8 - Environmental factors
Card 9 - Inner emotions
Card 10 - Final results\n
""",
dest="celtic",
action="store_true",
required=False,
)
# group.add_argument("-cc", "--celtic_cross",
# help="""
# 'Celtic Cross'\n
# A 10-card spread which reveals:
# Card 1 - The present condition of the querent
# Card 2 - Immediate influence / obstacles
# Card 3 - Goal / destiny according to existing circumstances
# Card 4 - Distant past foundation
# Card 5 - Recent past events
# Card 6 - Future influence
# Card 7 - The questioner
# Card 8 - Environmental factors
# Card 9 - Inner emotions
# Card 10 - Final results\n
# """,
# dest="celtic",
# action="store_true",
# required=False,
# )

group.add_argument("-ppf", "--past_present_future",
help="""
Expand All @@ -117,19 +120,19 @@ def main():
required=False,
)

group.add_argument("-ch", "--choices",
help="""
'Choices'\n
A 3-card spread which reveals:
Card 1 - Choice 1
Card 2 - Choice 2
Card 3 - Advice\n
Optional: Pull a single card afterwards as a clarifier
""",
dest="choices",
action="store_true",
required=False,
)
# group.add_argument("-ch", "--choices",
# help="""
# 'Choices'\n
# A 3-card spread which reveals:
# Card 1 - Choice 1
# Card 2 - Choice 2
# Card 3 - Advice\n
# Optional: Pull a single card afterwards as a clarifier
# """,
# dest="choices",
# action="store_true",
# required=False,
# )

group.add_argument("-cm", "--card_meaning",
type=int,
Expand Down Expand Up @@ -199,11 +202,47 @@ def main():
output.output_reading_only("Seen_Heard_Held_Reading_", reading)


# TODO: Celtic Cross Reading
# For "Celtic Cross" readings

# For "Past, Present, Future Spread" readings
if args.ppf:
args.card = None
cards = random.sample(reading, k=constants.ppf)

for i in range(len(cards)):
index = int(re.search(r'\((.*?)\)', cards[i]).group(1))
readings.past_present_future(cards)

for i in range(len(cards)):
index = int(re.search(r'\((.*?)\)', cards[i]).group(1))

# TODO: Past, Present, Future Spread
if args.interpretation is True and args.art is False:
print("...interpreting...")
time.sleep(2)
print(f"\n{card_meanings.meanings[index]}\n")
if args.output is True:
output.output_meaning("Past_Present_Future_Interpreted_", index)

if args.interpretation is False and args.art is True:
print("...generating card art...")
time.sleep(2)
print(f"\n{ascii_art.card_art[index]}\n")
if args.output is True:
output.output_art("Past_Present_Future_Art_", index)

if args.interpretation is True and args.art is True:
print("...interpreting and generating card art...")
time.sleep(2)
print(f"\n{ascii_art.card_art[index]}\n")
print(f"\n{card_meanings.meanings[index]}\n")
if args.output is True:
output.output_meaning_and_art("Past_Present_Future_Art_and_Meanings_", index)

if args.interpretation is False and args.art is False and args.output is True:
reading = card_directory.card_dict[index]
output.output_reading_only("Past_Present_Future_Reading_", reading)

# TODO: Choices Spread
# For "Choices" readings

# When someone tries to look up a card but forgets to specify card index
elif args.card == 1 and args.meaning is None:
Expand Down
1 change: 1 addition & 0 deletions cli_tarot/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
default_count = 1
default_meaning = 100
seen = 4
ppf = 3
10 changes: 10 additions & 0 deletions cli_tarot/readings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ def seen_heard_held(card_list):
time.sleep(1.5)
print(f"\n💫 Action 💫\n{card_list[3]}")
time.sleep(1)


def past_present_future(card_list):
time.sleep(1)
print(f"\nPast\n{card_list[0]}")
time.sleep(1.5)
print(f"\nPresemt\n{card_list[1]}")
time.sleep(1.5)
print(f"\nFuture\n{card_list[2]}")
time.sleep(1)
23 changes: 9 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "cli-tarot"
version = "1.0"
version = "1.0.3"
description = "A convenient way to get a tarot reading on your terminal!"
readme = "cli_tarot/README.md"
content-type = "text/markdown"
requires-python = ">=3.9"
authors = [
{name = "Bianca Henderson", email="[email protected]"},
]
readme = "cli_tarot.README.md"
license = {file = "cli_tarot.LICENSE.md"}

[tools.setuptools]
py_modules=["cli_tarot"]

[project.scripts]
cli-tarot = "cli_tarot.__main__:main"
author = "Bianca Henderson"
author_email = "[email protected]"
url = "https://github.com/beeankha/command_line_tarot"
keywords = ["tarot", "command line", "cli"]
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile pyproject.toml
#
8 changes: 6 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[metadata]
name = cli-tarot
version = 1.0
license = MIT

[options]
packages = find:
include_package_data = True

[options.entry_points]
console_scripts =
cli-tarot = cli_tarot.__main__:main

0 comments on commit faf0157

Please sign in to comment.