An example package
Project description
Stardew Wiki System Python Project Documentation
Overview
The Stardew Wiki System Python project provides a console-based interface to interact with two main categories of information in the game Stardew Valley:
- Living Things: Animals and crops in Stardew Valley.
- Recipes: Recipes and their associated ingredients.
The project is organized into subpackages (livingthings and recipes), each containing specific functionalities.
Project Structure
stardew_wiki/
├── __init__.py # Initializes the Stardew Wiki package
├── main.py # Entry point for the entire package
├── livingthings/ # Subpackage for animals and crops
│ ├── __init__.py
│ ├── main.py
│ ├── animals.py # Animal-related functionality
│ ├── crops.py # Crop-related functionality
│ ├── data/ # Data files for animals and crops
│ │ ├── Animals.csv
│ │ ├── Crops.csv
├── recipes/ # Subpackage for recipes and ingredients
│ ├── __init__.py
│ ├── main.py
│ ├── recipe_search.py # Recipe search functionality
│ ├── ingredient_search.py # Ingredient search functionality
│ ├── data/ # Data files for recipes
│ │ ├── wiki.xlsx
Main Features
Living Things
- Search for animals by name or type (Barn/Coop).
- Search for crops by name or season.
Recipes
- List all recipes.
- Search for recipes by name.
- Find recipes based on available ingredients.
- Suggest missing ingredients for a recipe.
- Explore ingredient details from crop and animal data.
Modules and Functions
Main Module
File: stardew_wiki/main.py
Description:
- Acts as the entry point for the entire package.
- Provides a menu-driven interface to access the livingthings and recipes subpackages.
Functions
- main(): Displays the main menu and navigates to subpackage functionalities.
Living Things Subpackage
File: stardew_wiki/livingthings
Description:
- Provides access to animal and crop-related data.
Modules
- animals.py:
-
Defines Animal, BarnAnimal, CoopAnimal, and AnimalDatabase classes.
-
Allows searching for animals by name or type.
Functions:
search_by_name(name): Finds an animal by name.search_by_type(type): Filters animals by type (Barn/Coop).input_animal(): Interactive function for searching animals via a menu.
- crops.py:
-
Defines Crop and CropDatabase classes.
-
Allows searching for crops by name or season.
Functions:
search_by_name(name): Finds a crop by name.search_by_season(season): Lists crops for a specific season.input_crop(): Interactive function for searching crops via a menu.
1. Module 1: animals.py
-
Function 1:
search_by_name(name)- Example Usage:
search_by_name(name)
- Output:
Enter the name of the animal: Cow Search Result: Name: Cow Growth Time: 5(night) Product: Milk (Price: 125) Artisan Product: Cheese (Price: 230) Type: Barn
- Example Usage:
-
Function 2:
search_by_type(type)- Example Usage:
search_by_type(type)
- Output:
Enter the type of animal (Barn/Coop): Barn Search Result: Name: Cow Growth Time: 5(night) Product: Milk (Price: 125) Artisan Product: Cheese (Price: 230) Type: Barn Name: Goat Growth Time: 5(night) Product: Goat Milk (Price: 225) Artisan Product: Goat Cheese (Price: 400) Type: Barn Name: Sheep Growth Time: 4(night) Product: Wool (Price: 340) Artisan Product: Cloth (Price: 470) Type: Barn Name: Pig Growth Time: 10(night) Product: Truffle (Price: 625) Artisan Product: Truffle Oil (Price: 1065) Type: Barn Name: Ostrich Growth Time: 7(night) Product: Ostrich Egg (Price: 600) Artisan Product: Mayonnaise(10) (Price: 190) Type: Barn
- Example Usage:
-
Function 3:
input_animal()- Example Usage:
input_animal()
- Output:
Animal Search Menu: 1. Search by Name 2. Search by Type (Barn/Coop) 3. Exit Enter your choice: 1
- Example Usage:
2. Module 2: crops.py
-
Function 1:
search_by_name(name)- Example Usage:
search_by_name(name)
- Output:
Enter the name of the crop: Corn Search Result: Name: Corn Season: Summer/Fall Growth Time: 14 Regrowth Time: 4.0 Price: 50 Crafting Product: Oil (Price: 100.0)
- Example Usage:
-
Function 2:
search_by_season(season)- Example Usage:
search_by_season(season)
- Output:
Enter the season (Spring/Summer/Fall/Tropical): Tropical Search Result: Cactus Pineapple Taro
- Example Usage:
-
Function 3:
input_crop()- Example Usage:
input_crop()
- Output:
Crop Search Menu: 1. Search by Name 2. Search by Season 3. Exit Enter your choice: 3
- Example Usage:
Recipes Subpackage
File: stardew_wiki/recipes
Description:
- Provides access to recipe and ingredient-related data.
Modules
- recipe_search.py:
-
Allows searching and listing of recipes.
Functions:
list_all_recipes(recipes_df): Lists all recipes.search_recipe_by_name(recipes_df): Finds a recipe by name.ingredient_details(crops_df, animals_df): Fetches details of an ingredient from crop and animal data.
- ingredient_search.py:
-
Finds recipes by available ingredients or suggests missing ones.
Functions:
list_all_ingredients(recipes_df): Lists all unique ingredients.search_recipes_by_ingredients(recipes_df): Finds recipes containing specific ingredients.suggest_missing_ingredients(recipes_df): Suggests missing ingredients for a recipe.
1. Module 1: recipe_search.py
-
Function 1:
list_all_recipes(recipes_df)- Example Usage:
list_all_recipes(recipes_df)
- Output:
Available Recipes: - Fried Egg - Omelet - Cheese Cauliflower - Vegetable Medley - Pizza - Bean Hotpot - Glazed Yams - Hashbrowns - Bread
- Example Usage:
-
Function 2:
search_recipe_by_name(recipes_df)- Example Usage:
search_recipe_by_name(recipes_df)
- Output 1:
Enter the name of the recipe to search: Pizza Recipe: Pizza Ingredients: Wheat Flour (1), Tomato (1), Cheese (1)- Output 2:
Enter the name of the recipe to search: C Recipe: Cheese Cauliflower Ingredients: Cauliflower (1), Cheese (1)
- Example Usage:
-
Function 3:
ingredient_details(crops_df, animals_df)-
Example Usage:
ingredient_details(crops_df, animals_df)
- Output 1:
Enter the ingredient name to see details (or type 'STOP' to quit): Wheat Ingredient found in Crops: Name: Wheat Craft Name: Wheat Flour Season: Summer/Fall Growth Time: 4 days Regrowth Time: nan days Price: 25 Craft Price: 50.0- Output 2:
Enter the ingredient name to see details (or type 'STOP' to quit): c Ingredient not found in Crops or Animals.
-
Module 2: ingredient_search.py
-
Function 1:
list_all_ingredients(recipes_df)- Example Usage:
list_all_ingredients(recipes_df)
- Output:
Unique Ingredients: - Beet - Cauliflower - Cheese - Egg - Green Bean - Milk - Oil - Potato - Sugar - Tomato - Wheat Flour - Yam
- Example Usage:
-
Function 2:
search_recipes_by_ingredients(recipes_df)- Example Usage:
search_recipes_by_ingredients(recipes_df)
- Output:
Enter ingredients one by one (type 'STOP' to finish): Enter ingredient: Egg Enter ingredient: Cheese Enter ingredient: STOP Recipes containing the ingredients: - Cheese Cauliflower - Fried Egg - Pizza - Omelet
- Example Usage:
-
Function 3:
suggest_missing_ingredients(recipes_df)- Example Usage:
suggest_missing_ingredients(recipes_df)
- Output:
Enter the name of the recipe: Pizza Enter the ingredients you already have (type 'STOP' to finish): Enter ingredient: Cheese Enter ingredient: STOP Missing Ingredients: - Wheat Flour - Tomato
- Example Usage:
Menu Options
1. List All Recipes
- Function:
list_all_recipes(recipes_df) - Description: Displays the names of all available recipes in the dataset.
- How to Use: Select option
1from the menu.
2. Search for a Recipe by Name
- Function:
search_recipe_by_name(recipes_df) - Description: Prompts the user to input a recipe name and displays its required ingredients.
- How to Use: Select option
2from the menu.
3. View Details of Ingredients
- Function:
ingredient_details(crops_df, animals_df) - Description: Allows the user to input an ingredient name and retrieves detailed information from the
CropsandAnimalsdatasets. Continues until the user inputsSTOP. - How to Use: Select option
3from the menu.
4. List All Unique Ingredients
- Function:
list_all_ingredients(recipes_df) - Description: Extracts and displays a list of unique ingredients used across all recipes.
- How to Use: Select option
4from the menu.
5. Search Recipes by Ingredients
- Function:
search_recipes_by_ingredients(recipes_df) - Description: Prompts the user to input ingredients one by one and searches for recipes containing those ingredients. Stops when the user inputs
STOP. - How to Use: Select option
5from the menu.
6. Suggest Missing Ingredients for a Recipe
- Function:
suggest_missing_ingredients(recipes_df) - Description: Prompts the user to input the name of a recipe and the ingredients they already have. Suggests the missing ingredients required to complete the recipe.
- How to Use: Select option
6from the menu.
7. Exit
- Description: Terminates the program.
- How to Use: Select option
7from the menu.
Usage
How to Run
-
Prerequisites:
- Python 3.x
- Required Libraries:
pandasopenpyxl(for reading Excel files)
-
Run the Script:
- Place the Excel file (
DATA581 Project csv.xlsx) in thedata/directory. - Execute the script:
python main.py
- Place the Excel file (
-
Follow the Menu:
- Interact with the program by selecting options from the menu and following the prompts.
Data Files
Animals Data (Animals.csv)
- Columns:
- name_animal: name of animals
- type: Barn/Coop animals
- growth_animal: time for animals to mature
- product_animal: the product of the animal
- product_animal_price: the price of the product
- artisan_animal: the artisan product made by the animal's product
- artisan_animal_price: the price of the artisan product
Crops Data (Crops.csv)
- Columns:
- name_crop: name of crops
- season: the growth season of the crop
- growth_crop: the time for the crop to mature
- regrowth_crop: the regrowth time for the crop
- crop_price: the price of the crop
- craft_crop: the crafting product of the crop
- craft_crop_price: the price of the crafting product
Recipes Data (wiki.xlsx)
Sheets:
- Recipes: Contains recipe names and ingredients.
- Crops: Crop-related information.
- Animals: Animal-related information.
Project details
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 stardew_valley_wiki-2.0.2.tar.gz.
File metadata
- Download URL: stardew_valley_wiki-2.0.2.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10a0058874563eeba83a560a713eee6a8561730aa48ac9f3f99bd852807cd824
|
|
| MD5 |
2dfde2ac8fd8ec33d10512725593b8ab
|
|
| BLAKE2b-256 |
7ac9cd87292e1dfe5088c62967b2f34d4a1513600cd5e3249f097ede390bffc2
|
File details
Details for the file Stardew_Valley_Wiki-2.0.2-py3-none-any.whl.
File metadata
- Download URL: Stardew_Valley_Wiki-2.0.2-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d42be14709e3175ca010e8f5a851528da64a7e28f7f0c662b83146216a9f71c7
|
|
| MD5 |
a8a1c444b968666e17b1d1556bd08048
|
|
| BLAKE2b-256 |
e43e1b76403a381cb33cf3d6ede7d3741f28fd0e01d0081c9351a1793769acb2
|