From 3cf8e9d257d19c5bed03860e857b79c7c5172df7 Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 13:43:26 +0100 Subject: [PATCH 1/8] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e110e1e..05077eaf 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Prjects lab python +# Project lab python From f2c8a9691f3150295d0d5ed7fdda4da474f977dc Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 15:58:27 +0100 Subject: [PATCH 2/8] Refactor CSV class and fix date format in plot_transactions method --- .../__pycache__/data_entry.cpython-312.pyc | Bin 2156 -> 2156 bytes Personal_Finance_Tracker/main.py | 3 ++- .../tempCodeRunnerFile.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Personal_Finance_Tracker/tempCodeRunnerFile.py diff --git a/Personal_Finance_Tracker/__pycache__/data_entry.cpython-312.pyc b/Personal_Finance_Tracker/__pycache__/data_entry.cpython-312.pyc index 93c0e834b264fd2ad62c653ef49c2e9535b4987d..2dcd54e18f0f89a59bad05c2d6f68e0b4fdc76c8 100644 GIT binary patch delta 19 ZcmaDO@J4{^G%qg~0}ya_Y~)Jf001{q1gHQ2 delta 19 ZcmaDO@J4{^G%qg~0}$M+*vOT{0RTJz1#JKT diff --git a/Personal_Finance_Tracker/main.py b/Personal_Finance_Tracker/main.py index e71219af..00d30bb4 100644 --- a/Personal_Finance_Tracker/main.py +++ b/Personal_Finance_Tracker/main.py @@ -65,12 +65,13 @@ def get_transactions(cls, start_date, end_date): print("\n Summary") print(f"Total Income: €{total_income: .2f}") print(f"Total Expense: €{total_expense: .2f}") - print(f"Net savings: €{(total_income - total_expense): .2f}") + print(f"Net savings: €{(total_income - total_expense):.2f}") return filtered_df @classmethod def plot_transactions(cls,df): + df["date"] = pd.to_datetime(df["date"], format="%d-%m-%Y") df.set_index("date", inplace=True) income_df = df[df["category"] == "Income"].resample("D").sum().reindex(df.index, fill_value=0) #Resampling the data to daily frequency diff --git a/Personal_Finance_Tracker/tempCodeRunnerFile.py b/Personal_Finance_Tracker/tempCodeRunnerFile.py new file mode 100644 index 00000000..79d95c35 --- /dev/null +++ b/Personal_Finance_Tracker/tempCodeRunnerFile.py @@ -0,0 +1 @@ +print(f"Net savings: €{(total_income - total_expense):.2f}") From dd173d8e5da45d77b5971371d1252ef6e7906f87 Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 16:06:14 +0100 Subject: [PATCH 3/8] included pytest in the rqt.txt file --- Personal_Finance_Tracker/requirements.txt | Bin 66 -> 92 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Personal_Finance_Tracker/requirements.txt b/Personal_Finance_Tracker/requirements.txt index 6d4dc8b1c88db6a8a9800c5a2c1964237775e8c0..aebac646aaf8200c82ddfd6dd4273db09fab4318 100644 GIT binary patch delta 31 kcmZ>YncyVF%fQ7@z);Ch!jQ^P3?%IsY#GcL^cV~n0AphXS^xk5 delta 4 Lcma!Xn&1Qg1DpYI From bf62f875d7de671fe714caf7ae335d49fe73ce4e Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 16:14:45 +0100 Subject: [PATCH 4/8] update rqt.txt file --- Personal_Finance_Tracker/requirements.txt | Bin 92 -> 70 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Personal_Finance_Tracker/requirements.txt b/Personal_Finance_Tracker/requirements.txt index aebac646aaf8200c82ddfd6dd4273db09fab4318..93f268cce1f14c632f76c45111e5c838dbb601e3 100644 GIT binary patch delta 4 Lcma!Xo8Sfj1FQjg delta 27 gcmZ>ZncyZ?z);Ch!jQ^P3?%IsY#GcL^cV~n09$1RM*si- From b43edd4bd43412001d65d7f610cbdcf2b245c699 Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 16:25:19 +0100 Subject: [PATCH 5/8] Refactor data_entry.py and add data entry functions --- Personal_Finance_Tracker/data_entry.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Personal_Finance_Tracker/data_entry.py b/Personal_Finance_Tracker/data_entry.py index ef995816..f90bf4f0 100644 --- a/Personal_Finance_Tracker/data_entry.py +++ b/Personal_Finance_Tracker/data_entry.py @@ -1,11 +1,16 @@ from datetime import datetime date_format = "%d-%m-%Y" + categories = { "I": "Income", "E": "Expense" } +""" +creating all data entry functions for the user to input the data +""" + def get_date(prompt, allow_default=False): date = input(prompt) if allow_default and not date: From ef81d5a5751cb2b07b9add1a85f4d30f692a0f00 Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 16:36:12 +0100 Subject: [PATCH 6/8] remove comments --- Personal_Finance_Tracker/data_entry.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Personal_Finance_Tracker/data_entry.py b/Personal_Finance_Tracker/data_entry.py index f90bf4f0..add03e9d 100644 --- a/Personal_Finance_Tracker/data_entry.py +++ b/Personal_Finance_Tracker/data_entry.py @@ -7,10 +7,6 @@ "E": "Expense" } -""" -creating all data entry functions for the user to input the data -""" - def get_date(prompt, allow_default=False): date = input(prompt) if allow_default and not date: From 6eab97fc620db148a750f48ca7452d8665a84244 Mon Sep 17 00:00:00 2001 From: Forestin WAMBA <121468179+Wambaforestin@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:40:06 +0100 Subject: [PATCH 7/8] Update ci_cd.yml --- .github/workflows/ci_cd.yml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index da56e6df..3df913f6 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -1,16 +1,12 @@ -name: CI Workflow +name: CI/CD Workflow on: push: branches: - master - pull_request: - branches: - - master - jobs: - test: + build: runs-on: ubuntu-latest steps: @@ -20,21 +16,19 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.12.7' - - - name: Find and Install Dependencies - run: | - python -m pip install --upgrade pip - # Find all requirements.txt files and install dependencies for each - for req_file in $(find . -name "requirements.txt"); do - echo "Installing dependencies from $req_file" - pip install -r "$req_file" - done + python-version: '3.12.7' - - name: Run Tests + - name: Install dependencies for each subproject run: | - # Run tests in each subproject that contains tests - for test_dir in $(find . -type d -name "tests"); do - echo "Running tests in $test_dir" - pytest "$test_dir" + # Loop through each subproject directory + for dir in projects/*; do + if [ -d "$dir" ]; then + echo "Installing dependencies for $dir" + # Check if requirements.txt exists in the subproject + if [ -f "$dir/requirements.txt" ]; then + pip install -r "$dir/requirements.txt" + else + echo "No requirements.txt found in $dir" + fi + fi done From 87b499071c315d600af3dd4be01b738037890c47 Mon Sep 17 00:00:00 2001 From: Wambaforestin Date: Mon, 28 Oct 2024 20:19:52 +0100 Subject: [PATCH 8/8] Refactor data_entry.py and main.py files --- .../__pycache__/data_entry.cpython-312.pyc | Bin 2156 -> 2158 bytes Personal_Finance_Tracker/finance_date.csv | 2 +- Personal_Finance_Tracker/main.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Personal_Finance_Tracker/__pycache__/data_entry.cpython-312.pyc b/Personal_Finance_Tracker/__pycache__/data_entry.cpython-312.pyc index 2dcd54e18f0f89a59bad05c2d6f68e0b4fdc76c8..fcde98c0b2fd8bd879319695b50f2f920dd8dac9 100644 GIT binary patch delta 75 zcmaDO@J@jDG%qg~0}$A*mrv)|$orj%k!v$6^D{<9vCVH-elapCOn%Pxgi&+y8TL#u e1E9JO%#4hTcNt_K@JTdqe_&(a5}NGEp$q^xnH1;% delta 73 zcmaDS@J4|5G%qg~0}ya_$fvVy