{"id":72,"date":"2026-03-13T14:51:41","date_gmt":"2026-03-13T14:51:41","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/r_najim\/?p=72"},"modified":"2026-03-13T14:51:41","modified_gmt":"2026-03-13T14:51:41","slug":"friday-march-13-2026","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/r_najim\/2026\/03\/13\/friday-march-13-2026\/","title":{"rendered":"Friday, March 13, 2026"},"content":{"rendered":"\n<p><strong>Today This Free Friday I am working on a project on YouTube a<\/strong> <strong>Personal Finance Tracker part 3.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=Dn1EjhcQk64&amp;t=2486s\">https:\/\/www.youtube.com\/watch?v=Dn1EjhcQk64&amp;t=2486s<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code> @classmethod\n    def get_transactions(cls, start_date, end_date):\n        df = pd.read_csv(cls.CSV_FILE)\n        df&#91;\"date\"] = pd.to_datetime(df&#91;\"date\"], format=CSV.FORMAT)\n        start_date = datetime.strptime(start_date, CSV.FORMAT)\n        end_date = datetime.strptime(end_date, CSV.FORMAT)\n\n        mask = (df&#91;\"date\"] >= start_date) &amp; (df&#91;\"date\"] &lt;= end_date)\n        filtered_df = df.loc&#91;mask]\n\n        if filtered_df.empty:\n            print('No transaction found in the given date range')\n\n        else:\n            print(f\"Transactions from{start_date.strftime(CSV.FORMAT)} to {end_date.strftime(CSV.FORMAT)}\")\n\n            print(filtered_df.to_string(index=False, formatters={\"date\": lambda x: x.strftime(CSV.FORMAT)}))\n\n            total_income = &#91;filtered_df&#91;\"category\"] == \"Income\"]&#91;\"amount\"].sum()\n            total_expense = filtered_df&#91;filtered_df&#91;\"category\"] == \"Expense\"]&#91;\"amount\"].sum()\n            print(\"\\nSummary:\")\n            print(f\"Total Income: ${total_income:.2f}\")\n            print(f\"Total Expense: ${total_expense:.2f}\")\n            print(f\"Net Savings: ${(total_income - total_expense):.2f}\")\n\n            return filtered_df<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>This part of the code is to Give the users all the transactions within a Date range<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>def main():\n    while True:\n        print(\"\\n1. Add a new transaction\")\n        print(\"2. view transactions and summary within a date range\")\n        print(\"3. Exit\")\n        choice =input(\"Enter your choice (1-3):\")\n\n        if choice == \"1\":\n            add()\n\n        elif choice == \"2\":\n            start_date = get_date(\"Enter the start date (dd-mm-yyyy): \")\n            end_date = get_date(\"Enter the end date (dd-mm-yyyy):\")\n            df = CSV.get_transactions(start_date, end_date)\n\n        elif choice == \"3\":\n            print(\"Exiting...\")\n            break\n        else:\n            print(\"Invalid choice. Enter 1, 2, or 3.\")\n\nif__name__ == \"__main__\":\n    main()<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>This part of the code is for the users to pick one of the choices and the input of a choice.<\/strong><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today This Free Friday I am working on a project on YouTube a Personal Finance Tracker part 3.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":2,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/72\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}