Built Oracle, a prophet that can do multiple things, including spit fortunes (fortune cookie), output a random decision (8ball), give a quick, random mood (vibe check), and output a random pet (petting zoo).
Project description
Python Package Exercise
Built Oracle, a prophet that can do multiple things, including spit fortunes (fortune cookie), output a random decision (8ball), give a quick, random mood (vibe check), and output a random pet (petting zoo).
Badge
Link to Package Page
Team Members
Christopher Li, Julie Chen, Maddy Li, Aneri Shah
Using Oracle in Your Project
Installation
pip install oracle
Usage
Running the program
python oracle/cli.py <function name> <argument(s)>
Fortune Cookie
get_fortune(mood)→str: accepts a mood and returns a random fortune fitting the corresponding mood
from oracle.fortune_cookie import get_fortune
# Get a fortune based on mood
optimistic_fortune = get_fortune("optimistic")
realistic_fortune = get_fortune("realistic")
unfortunate_fortune = get_fortune("unfortunate")
print(optimistic_fortune) # Outputs a random optimistic fortune
Magic 8-Ball
get_eight_ball(num)→str: accepts a integer and returns the specified number of 8-ball predictions
from oracle.eight_ball import get_eight_ball
# Get a single decision
decision = get_eight_ball(1)
# Get multiple decisions
decisions = get_eight_ball(3)
print(decisions) # Outputs random decision(s)
Vibe Check
get_vibe_check(vibes)→str: accepts a mood and returns a corresponding affirmation
from oracle.vibe_check import get_vibe_check
# Check different vibes
good_vibe = get_vibe_check("good")
bad_vibe = get_vibe_check("bad")
random_vibe = get_vibe_check("random")
print(random_vibe) # Outputs a random vibe
Petting Zoo
get_random_pet()→str: when called, it returns a random ASCII animal
get_pet(pet)→str: accepts an animal name, and prints the corresponding ASCII animal if it exists.
from oracle.petting_zoo import get_random_pet, get_pet
# Check different vibes
dog = get_pet("dog")
cat = get_pet("cat")
rabbit = get_pet("rabbit")
hamster = get_pet("hamster")
goat = get_pet("goat")
sheep = get_pet("sheep")
bird = get_pet("bird")
frog = get_pet("frog")
bear = get_pet("bear")
fox = get_pet("fox")
print(fox) #prints fox pet
print(get_random_pet()) # Outputs a random pet
Example Code
See example.py for sample code.
Contributing to Oracle
Setting Up Development Environment
- Ensure you have python 3.11 or higher.
- Fork and clone the repository:
git clone https://github.com/software-students-fall2024/3-python-package-burger-flippers
cd 3-python-package-burger-flippers
- Install pipenv if you haven't already:
pip install pipenv
- Create virtual environment and install dependencies:
pipenv install --dev
- Activate the virtual environment:
pipenv shell
Building the Package
Build the package locally:
python -m build
This will create both source distribution and wheel in the dist/ directory.
Running Tests
Run the test suite:
pipenv run pytest
Development Workflow
- Create a new branch for your feature (change feature-name to your liking):
git checkout -b feature-name
- Create a new file for your new feature in the oracle folder for your new feature
touch oracle/new-feature.py
- After coding the new feature, create a test file with corresponding test cases
touch tests/test-new-feature.py
- Make your changes and write tests
- Run tests to ensure everything works:
pipenv run pytest
- Submit a pull request with your changes
Notes
- No environment variables or database setup is required for this project
- No secret configuration files are needed
- The project uses standard Python packaging tools (setuptools)
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 random_oracle-0.1.0.tar.gz.
File metadata
- Download URL: random_oracle-0.1.0.tar.gz
- Upload date:
- Size: 44.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d79641f0ac21d518ba69942f09b5799b367cfdcf98dc34e5d3af2b216ab1fc2
|
|
| MD5 |
7e1c35e0746ada81a3845e6d2e5ee6c1
|
|
| BLAKE2b-256 |
d20c3f74ee4356a10a09d163e522b3816b4d822ae0eb1a755aff91ca71f7d3f4
|
File details
Details for the file Random_Oracle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: Random_Oracle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ac1d85b0617f478c622f658c659c121b9aa56a967ee9a2b5d64907c73f4b36
|
|
| MD5 |
cb33853a72d607b65c95ba36d5c8e375
|
|
| BLAKE2b-256 |
84e3c89ec7923fd5a54e98ddac1a3b5cc81471f349d68beaad338c8d0a20d3ee
|