A package that generates “fortune cookie” messages, programming wisdom, or absurd advice when called.
Project description
Fortune Cookie Cravaggio
Team members: Nina Li, Sirui Wang, Bohan Yin, Nick Zhu
Table of Contents
Description
A package that generates “fortune cookie” messages, programming wisdom, or absurd advice when called.
You can find the package here:
Installation
Below is how you can import the Fortune Cookie Generator package into your own projects using pip.
1. Install the package
pip install fortunecookiecravaggio
2. Import the functions in your Python code
from fortunecookiecravaggio import get_fortune, fortune_of_the_day, custom_fortune, fortune_with_ascii_art
3. Add a fortunes.txt in the directory
Create your own or download the predefined list fortunes.txt
Usage Examples
See example.py
1. Get a random fortune based on user input: get_fortune("Any word, phrase, or thought")
user_input = input("Enter a word, phrase, or thought to receive your fortune: ")
print(get_fortune(user_input))
2. Discover the daily prophecy: fortune_of_the_day()
print("Fortune of the Day:", fortune_of_the_day())
3. Add your own fortune messages: custom_fortune("Custom message")
custom_msg = input("Enter your custom fortune message: ")
added_msg = custom_fortune(custom_msg)
print("Custom fortune added:", added_msg)
4. Get a fortune with an ASCII fortune cookie: fortune_with_ascii_art()
print(fortune_with_ascii_art())
Contributing
Here’s how you can help:
1. Clone the repository
git clone https://github.com/software-students-spring2025/3-python-package-cravaggio
cd 3-python-package-cravaggio
2. Create a branch
git checkout -b yourbranchname
3. Set up virtual environment
pip install pipenv
pipenv install --dev
pipenv shell
4. Make your changes
5. Commit and Push
git add .
git commit -m "your changes"
git push origin yourbranchname
6. Submit a pull request with your changes
7. (optional) Test, build and upload
pytest
python -m build
twine upload -r testpypi dist/*
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters