A fun Python package that generates random fortunes with a date.
Project description
fortune_package
Description
A small Python package to make your day just a bit brighter while coding! Test your luck and explore the many fortunes we've included. If you're lucky (or unlucky), the fortune you receive might just come true.
PyPI Link
Installation & Setup
Installing Dependencies & Setting Up a Virtual Environment
To install the required dependencies and set up a virtual environment:
- Install pipenv (if you haven’t already):
pip install pipenv
- Create and enter a virtual environment, then install dependencies:
pipenv install pipenv shell
- Install our fortune-teller package:
pip install fortune-teller2607555==0.1.1
Overview of Provided Functions
cs_fortune(category: str)- Returns a computer science-themed fortune from one of these categories:
tech,startup,open source,ai, orcareer. - If the category is invalid, it returns an
"Oops:"error message.
from fortune_teller.cs_fortune import cs_fortune fortune = cs_fortune("tech") print(fortune)
- Returns a computer science-themed fortune from one of these categories:
mood_fortune(mood: str)- Returns a fortune based on your mood:
positive,funny,cursed,motivational). - If the mood is invalid, it returns an
"Oops:"error message.
from fortune_teller.mood_fortune import mood_fortune fortune = mood_fortune("funny") print(fortune)
- Returns a fortune based on your mood:
fortune_story(name: str)- Returns a personalized fortune story that includes the name you provide.
- If the name is invalid (empty), it returns an error message.
from fortune_teller.fortune_stories import fortune_story story = fortune_story("Alice") print(story)
rand_date_time(current_date_str: str, fortune: str)- Combines a given fortune message with a random future date (up to December 31, 2060).
- The
fortuneparameter must come from one of the other functions:cs_fortune,mood_fortune, orfortune_story). - If the user-supplied date is beyond December 31, 2060 or invalid, it returns an error message.
from fortune_teller.date_time import rand_date_time from fortune_teller.cs_fortune import cs_fortune my_cs_fortune = cs_fortune("tech") dated_fortune = rand_date_time("2025-01-01", my_cs_fortune) print(dated_fortune)
Usage Examples
- Direct Function Import
If you simply want to call a fortune function,
cs_fortune, for instance:
from fortune_teller.cs_fortune import cs_fortune
fortune = cs_fortune("ai")
print("AI Fortune:", fortune)
- Try Our Interactive CLI
We include a
get_started.pyscript that lets you interactively pick any fortune type from the command line, combine it with a random future date, and see the final result printed with fun ASCII art. To try it:
- Navigate to your project folder
- Run:
python -m fortune_teller.get_started
- Follow the menu prompts to select your fortune type:
mood_fortune,fortune_story, orcs_fortune) or quit. You’ll see a fun ASCII “cookie” and your fortune each time!
For a complete example of all functions, check out get_started.py.
Contribution Guidelines
We welcome contributions! If you'd like to contribute:
- Fork the repository.
- Create a new branch for your feature or fix.
- Ensure your changes integrate well with existing tests and add new tests if necessary.
- Submit a pull request for review.
Code Testing
Run tests locally before submitting your new code:
pipenv install --dev pytest
pipenv run python -m pytest tests/
The Team
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
File details
Details for the file fortune_teller2607555-0.1.1.tar.gz.
File metadata
- Download URL: fortune_teller2607555-0.1.1.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd353b9d7f2571bc417110a8c760daf0a43824a7d40fc9e7d901cf3aea1f7c9
|
|
| MD5 |
ab9910fddd24f6a0ac84be36d87a4018
|
|
| BLAKE2b-256 |
4c3d8f9a928ff72678e05436da685d5acad47e55c4c4d3652f2c836d939e8fa9
|
File details
Details for the file fortune_teller2607555-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fortune_teller2607555-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093527c9d0cdff2378721b80367eeba2532f29d91c28e39126d7806131cd6f9b
|
|
| MD5 |
3b4f7b0f21a7243af1468ad37555f425
|
|
| BLAKE2b-256 |
c655e09acbad4ef64b3c0f6c7518d2fd7da04b13219fc8efa90aa6cd185b1aeb
|