Wad's Up helps tourists and day-trippers to determine which Dutch Wadden Island best matches their preferences.
The Dutch Wadden Islands are beautiful and very popular. It is difficult for tourists and day trippers to choose which island they want to visit. Wad's Up assists them with this. Wad's Up will ask the user about their preferences regarding 3 characteristics of the islands (car-free, cycling network and ferry price). The preferences will be scored with a 5-point Likert scale. In this way the most suitable island for the user can be determined. If multiple islands have the same score, the winning island will be determined randomly. This is to prevent choice overload (for the user). Once the winning island has been determined, some statistics are shown and the winning island is returned to the user. Cowsay is used here so that some ASCII art is created. And a video starts about the winning island.
Below a list of the different files that are part of the project. For the first two files a list of the functions is given. A short description is given of each function.
- main(): starting point of execution of Wad's Up
- def check(answer, name): checks if user is interested in visiting a Dutch Wadden islands
- def user_input(): collects user input regarding their preferences
- def preferences(no_cars, ferry, cycle_network): calculates the score on a Likert scale and updates dictionary where the scores are kept
- def determine_winner(islands): determines winner. If multiple winners, randomly chooses a winner
- def stats(islands): converts dictionary in pandas DataFrame and calculates mean and median
- def your_destiny(name, island): returns winner to user
- def countdown(t): counts down to zero after which the YouTube video about winning island is started'
- def youtube(island_url): starts video of winning island
- def test_check_yes(): tests user input 'yes' and 'YEs'
- def test_check_no(): tests user input 'n'
- def test_user_input(): tests storing user input in a list
- def test_preferences(): tests if user input calculates the right score
- def test_your_destiny(): prints winning island using cowsay
- def test_your_destiny_wrong_island(): tests input 'wrong' island
- def test_determine_winner_one_winner(): tests one winner
- def test_determine_winner_multiple_winner(): tests if winner is in list of islands with the same score
- def test_stats(): Testing if pandas dataframe is created, mean and median
- def test_countdown(): Function tests if "None" is returned
Package Version
------- -------
colorama 0.4.4
cowsay 6.1
mypy 1.7.0
pandas 2.1.3
pytest 7.4.3
pytube 15.0.0
PEP 8 and PEP 257 (Docstring Conventions) provide code conventions. This can be deviated from if there is good reason for doing so. The most important thing is monitoring consistency within a project and a module. The aim at Wad's Up has been to write readable and consistent code that follows the conventions laid down in PEP 8 and PEP 257. To check this, the following programs were used::
- Black: [https://black.readthedocs.io/en/stable/]
- Pylint[https://pypi.org/project/pylint/]
- style50
Likert questions were chosen to measure the user's preferences. For the Likert questions, users have 5 answer options. This allows the score to be measured more accurately than with yes/no questions.
Pylint E1101: Module 'cowsay' has no 'tux' member (no-member) was disabled in "def your_destiny(name, island)" because it gives a false positive: [pylint-dev/pylint#3684]
- Open Visual Studio Code or another IDE
- Place the files "project.py", "test_project.py" and "requirement.txt" in the same top-level root directory (folder)
- install the folowing packages: cowsay, mypy 1.7.0, pandas, pytube and types-colorama
- excecute project.py with "python project.py"
- give user input when asked
- when finished book the ferry to your favorite island🙂