Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4cf4d44
Feat: Added main.py (runs Travel Itinerary Planner app) and README.md…
xInsanityInRed Nov 27, 2025
55d26c9
Feat: Added Itinerary class (itinerary.py) and itinerary serializatio…
xInsanityInRed Nov 27, 2025
f3354be
Feat: Added add_itinerary functionality to main program (main.py) and…
xInsanityInRed Nov 27, 2025
bf66474
Feat: Added empty unittest file for manage_itineraries.py file.
xInsanityInRed Nov 27, 2025
f836acd
Chore: Added docstring for validation function & minor editing.
xInsanityInRed Nov 27, 2025
00864d2
Feat: add_itinerary feature completed
xInsanityInRed Nov 30, 2025
5dcea41
Feat: view_itinerary feature added and works successfully.
xInsanityInRed Nov 30, 2025
aa82bf9
Feat: Added itinerary editing functionality (edit_itinerary(), add_ne…
xInsanityInRed Dec 6, 2025
312fb13
Feat: Added delete functionality (delete itinerary, itinerary flight,…
xInsanityInRed Dec 6, 2025
eda89c5
Fix/chore: moved all uses of pick module to main.py to successfully u…
xInsanityInRed Dec 6, 2025
709924f
Chore: removed unnecessary requirements and files
xInsanityInRed Dec 6, 2025
1c62ba0
Beginning testing stage using unittest module (test_manage_itinerarie…
xInsanityInRed Dec 6, 2025
a503f08
Fix: Renamed folder to remove whitespaces
xInsanityInRed Dec 6, 2025
0dc9377
Chore: changed directory name again, plus added template to test_mana…
xInsanityInRed Dec 6, 2025
2ce14da
Feat(unittest): unittests for adding duplicate itineraries finished, …
xInsanityInRed Dec 6, 2025
b28a1eb
Fix: Fixed validate_dates() function after datetime related unittests…
xInsanityInRed Dec 6, 2025
0c24707
Feat(unittest): Completed test_add_itinerary_with_invalid_dates unitt…
xInsanityInRed Dec 6, 2025
bdb9b6c
Bugfix(improve unittesting): Moved functionality to prompt user for n…
xInsanityInRed Dec 7, 2025
79764c2
Chore: Replaced the input()'s overlooked in edit_itinerary() with "ne…
xInsanityInRed Dec 7, 2025
8015e2c
Feat(unittest): Fixed code issues in edit_itinerary() and passed test…
xInsanityInRed Dec 7, 2025
a84fd77
Chore: minor code cleanup for readability and functions return boolea…
xInsanityInRed Dec 7, 2025
200828a
Feat: Completed all unittests!
xInsanityInRed Dec 7, 2025
28ae0d8
Feat: Updated README.md and added images used in it.
xInsanityInRed Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Travel_Itinerary_Planner/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 127
max-complexity = 10
select = E9,F63,F7,F82
54 changes: 54 additions & 0 deletions Travel_Itinerary_Planner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Travel Itinerary Planner
This application lets you add, edit, view and delete itineraries from a CLI/terminal.
- Add and save an itinerary to an itineraries binary file that can be loaded and updated.
- Edit a saved itinerary item (e.g., name, location, flight departure date & time).
- Add multiple flights and/or attractions to one of the existing itineraries.
- View your itineraries (or a specific itinerary) in a formatted table.
- Delete a full itinerary, or just a flight or attraction from a specific itinerary (note: can only delete flights/attractions if there are more than 1 associated with that itinerary).

# Prerequisites
- Python 3.14
- pip (Python package installer)
- Command Line/Terminal (to run the application)
- rich 14.2.0
- pick 2.4.0

# Installing instructions
1. Clone the repository to your local machine
```bash
git clone https://github.com/king04aman/All-In-One-Python-Projects.git
```
2. Change directory into the cloned repository
```bash
cd All-In-One-Python-Projects/'Travel_Itinerary_Planner'/
```
3. Install the required libraries
```bash
pip install -r requirements.txt
```
4. Run the program in Command Line or Terminal using
```bash
python3 main.py
```

# Screenshot
### Welcome to the Travel Itinerary Planner!
![Welcome to the Travel Itinerary Planner!](assets/welcome-to-the-app.png)

### Choose what items to edit
![Choose itinerary to edit](assets/choose-itinerary-to-edit.png)
![Choose itinerary key to edit](assets/choose-item-key-to-edit.png)

### View your itineraries, formatted into a neat table!
![View itineraries in a table format](assets/view-itineraries.png)

### And other neat features listed at the top of this document :)

# Author
Gabrielle Allan

# Library credits

[pick library](https://pypi.org/project/pick/)

[rich library](https://github.com/Textualize/rich)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
374 changes: 374 additions & 0 deletions Travel_Itinerary_Planner/main.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Travel_Itinerary_Planner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flake8==7.3.0
pick==v2.4.0
rich==14.2.0
27 changes: 27 additions & 0 deletions Travel_Itinerary_Planner/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from setuptools import setup, find_packages

setup(
name="task_manager_cli", # Updated project name
version="0.2", # Updated version to reflect the new project
packages=find_packages(where='src'), # Automatically locate packages under 'src'
package_dir={'': 'src'}, # Packages are located in the 'src' directory

# Dependencies required for the updated functionality
install_requires=[
"pick==2.4.0",
"python-dateutil>=2.8", # For robust date validation
"rich==14.2.0", # FIRST ISSUE: For formatted table
"colorama==0.4.6",
"markdown-it-py==3.0.0",
"mdurl==0.1.2",
"Pygments==2.19.1",
"six==1.17.0",
"coverage",
"flake8==7.3.0",
"pick==v2.4.0"
],

# Project metadata
author="Gabrielle",
author_email="[email protected]",
)
Empty file.
37 changes: 37 additions & 0 deletions Travel_Itinerary_Planner/src/file_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
import pickle
from pprint import pprint

ITINERARY_FILE = "itineraries.bin"
# Used \\ because of this warning: https://stackoverflow.com/questions/52335970/how-to-fix-syntaxwarning-invalid-escape-sequence-in-python
current_directory = f"{os.getcwd()}\\{ITINERARY_FILE}"
print(current_directory)


def load_itineraries():
"""
Load tasks from a binary file using the pickle module.

Returns:
dictionary: A dictionary of Itinerary objects loaded from the binary file.
If the file does not exist, an empty dictionary is returned.
"""
if os.path.exists(current_directory):
with open(ITINERARY_FILE, "rb") as file:
return pickle.load(file)
return []


def save_itineraries(itineraries):
"""
Save a list of itineraries to a binary file using the pickle module.

Args:
itineraries (dict): A dictionary containing Itinerary objects to save.

Side Effects:
- Writes the serialized itinerary dictionary to ITINERARY_FILE.
- Overwrites the file if it already exists.
"""
with open(current_directory, "wb") as file:
pickle.dump(itineraries, file)
Loading