0% found this document useful (0 votes)
18 views20 pages

Pankaj Project Final Cs File

Hi

Uploaded by

rahulthakur30051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views20 pages

Pankaj Project Final Cs File

Hi

Uploaded by

rahulthakur30051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

GBSSSGOKALPURVI

LLAGEDELHI
-94
COMPUTERSCI
ENCE
PROJECTFI
LE
Sessi
on:
-2023-
24

NAME:
-PANKAJKUMAR
CLASS:
-11t
hB
ROLLNO.
:-11239
SUBMI
TTEDTO:
-MR.MOHI
TGI
RI
CERTIFICATE

THIS IS TO CERTIFY THAT PANKAJ KUMAR OF CLASS 11B OF


GBSSS HAS SUCCESSFULLY COMPLETED
THE PROJECT WORK OF COMPUTER SCIENCE OF CLASS XI
PRACTICAL EXAMINATION OF THE CENTRAL BOARD OF SECONDARY
EDUCATION IN THE YEAR 2023-2024.
IT IS FURTHER CERTIFIED THAT THIS PROJECT IS THE
INDIVIDUAL WORK OF THE CANDIDATE AND UPTO AS PER MY
EXPECTATIONS ISSUED BY CBSE.MR. MOHIT GIRI, COMPUTER
TEACHER.
INDEX
S.NO. TOPIC DATE REMARKS
1 System
Requirements Of
Python
2 Feature Of
Python
3 Project-Finance
Tracker
4 Benefits Of
Finance Tracker
5 Keywords Used
in Source Code
6 How the Project
Works
7 Source Code
8 Output Of
Project
SYSTEM REQUIREMENTS FOR PYTHON
PROGRAMMING LANGUAGE:-
1. **Operating System:** Windows 7, macOS 10.13, or a modern
Linux distribution.

2. **Processor:** 1 GHz or faster.


3. **RAM:** Minimum of 1 GB.
4. **Disk Space:** At least 100 MB free.
5. **Python Version:** Compatible with Python 3.10 and later.
Feature Of Python Programming Language:--
1. **Easy to Learn and Readable Syntax:** Python's syntax is
straightforward and easy to understand, making it an excellent
choice for beginners. This readability promotes clear and
concise code.

2. **Object-Oriented Programming (OOP):** Python supports object


-oriented programming principles, allowing for the creation and
manipulation of classes and objects. This promotes code
organization and reusability.

3. **Dynamic Typing and Automatic Memory Management:** Python


uses dynamic typing, allowing variables to change types during
runtime. Additionally, it has automatic memory management,
handled by a built-in garbage collector, making memory
allocation and deallocation seamless for developers.

4. **Extensive Standard Library:** Python comes with a vast


standard library that includes modules and packages for various
functionalities, reducing the need for external libraries in
many cases. This makes it easy to access a wide range of tools
and resources without additional installations.

5. **Community Support and Large Ecosystem:** Python has a


thriving community of developers contributing to its ecosystem.
This results in a wealth of third-party libraries and frameworks
that extend Python's capabilities for diverse applications, from
web development to data science.
Project:-
FINANCE TRACKER SYSTEM:-
A finance tracker project in Python could involve creating a
budgeting tool that allows users to input their income and
expenses, categorize transactions, and visualize their
financial data.
You can use libraries like Matplotlib or Plotly for graphs
and Tkinter for the user interface. Consider incorporating
features like expense trend analysis, budget alerts, and
monthly summaries.
BENEFITS OF FINANCE TRACKER PROJECT:-
The finance tracker project offers several benefits,
both for users and developers:

1. **Personal Financial Management:** Users can easily manage


their finances by tracking income, expenses, and overall balance,
providing a clear overview of their financial situation.

2. **Expense Tracking:** The project allows users to


categorize and track their expenses, enabling them to identify
spending patterns and make informed financial decisions.

3. **Budgeting Assistance:** Users can set income and expense


targets, helping them create and adhere to a budget. The tracker
provides insights into budget adherence and highlights areas for
improvement.

4. **Transaction History:** The inclusion of a transaction


history provides a detailed record of financial activities,
fostering transparency and accountability.

5. **Data Visualization:** The project utilizes Matplotlib to


create visual representations of expense distribution, offering
users a quick and intuitive way to understand their spending
patterns.

6. **User-Friendly Interface:** The Tkinter GUI provides a


user-friendly environment, making it accessible for individuals
with varying levels of technical expertise.

7. **Database Integration:** The use of SQLite facilitates


data persistence, allowing users to store and retrieve financial
data across multiple sessions.

8. **Customization:** Developers can easily extend and


customize the project to include additional features, such as
more advanced analytics, reminders, or integration with external
financial services.

9. **Educational Purpose:** The project can serve as a


learning tool for individuals looking to understand Python
programming, GUI development with Tkinter, database integration
with SQLite, and data visualization using Matplotlib.

10. **Open Source and Extendable:** The project can be shared


as an open-source resource, encouraging collaboration and
contributions from the developer community. It can also serve as
a foundation for building more comprehensive finance management
tools.

11. **Practical Programming Skills:** Developers gain


practical experience in designing and implementing a full-stack
application, encompassing user interface design, backend logic,
and database management.

By combining these benefits, the finance tracker


project serves as a practical tool for personal
financial management and a valuable learning resource
for developers interested in building applications with
Python and associated libraries.
KEYWORDS USED IN FINANCE TRACKER
PROJECT:-
Here are some keywords used in the finance tracker project:

1. **Python**: The programming language used to implement the


project.
2. **Tkinter**: A Python library for creating GUI applications.
3. **import:** Used to bring external libraries or modules into
the current script.

4. **tkinter:** A GUI (Graphical User Interface) library for


creating interactive and visually appealing desktop applications.

5. **as:** Renaming an imported module or library for easier


reference in the code.

6. **tk:** Alias for the `tkinter` module, often used to


reference Tkinter classes and functions.

7. **from:** Used in conjunction with `import` to specify a


particular submodule or element to import from a larger module.

8. **ttk:** Part of Tkinter, provides themed widgets with a more


modern and consistent appearance.

9. **messagebox:** A submodule of Tkinter used to create pop-up


message boxes in the GUI.
10. **sqlite3:** A module that provides a lightweight disk-based
database. In this code, it's used for creating and managing an
in-memory database.

11. **datetime:** A module for working with dates and times.


Here, it's used to get the current date and time for
transactions.

12. **class:** Defines a class in object-oriented programming.


In this case, `FinanceTracker` is a class representing the
finance tracking application.

13. **def:** Used to define a function within a class or


standalone function.

14. **init:** Special method in a class (constructor) that is


automatically called when an object is created. It initializes
the object's attributes.

15. **self:** Refers to the instance of the class. It is the


first parameter in a class method and is used to access class
attributes.

16. **if:** Conditional statement, executes a block of code only


if a specified condition is true.

17. **return:** Used to exit a function and return a value.

18. **__name__:** A special variable in Python that is set to


"__main__" if the script is being run directly, not imported as
a module.

17. **for:** Keyword used in a loop structure to iterate over a


sequence (here, used to iterate over transactions).
19. **or:** Logical operator, returns the first true operand or
the last operand if none are true. In this code, it's used in
handling a potential `None` value when fetching the total amount
from the database.

Understanding these keywords will help you comprehend the code


and make modifications if needed.
HOW FINANCE TRACKER PROJECT WORKS:-

The finance tracker project is designed to help users


manage their finances through a graphical user
interface (GUI) implemented using Python and Tkinter.
Here's how it works:

1. **Initialization:**
- The `FinanceTracker` class is initialized with a Tkinter
`root` window.
- Variables are created using `tk.StringVar()` and
`tk.DoubleVar()` to store transaction category, amount, and
budget values.

2. **Database Setup:**
- An SQLite in-memory database is created using
`sqlite3.connect(":memory:")`.
- `create_tables` method sets up a table named "transactions"
if it doesn't exist, with columns for transaction id, category,
amount, and date.

3. **User Interface (UI) Setup:**


- Entry widgets and labels are used to take user input for
transaction category and amount.
- A button is provided to add transactions, calling the
`add_transaction` method.
- Labels display the current budget, balance, and a treeview
for transaction history.

4. **Adding Transactions:**
- The `add_transaction` method fetches category and amount
from the respective variables.
- The current date and time are obtained using
`datetime.now()` and stored in the SQLite database.

5. **Calculating Balance:**
- `calculate_balance` fetches the total amount of all
transactions from the database and subtracts it from the budget.

6. **Updating Balance:**
- `update_balance` updates the balance label with the current
calculated balance.

7. **Displaying Transaction History:**


- `display_transaction_history` retrieves transactions from
the database and populates a `Treeview` widget with the
transaction details.

8. **Main Application Loop:**


- The `if __name__ == "__main__":` block creates the Tkinter
root window and the `FinanceTracker` instance, then starts the
main loop with `root.mainloop()`.

The application allows users to input transactions, displays a


transaction history, and updates the balance dynamically. The
database is used to store transaction details. The UI is created
using Tkinter widgets, and actions are triggered by user
interactions..
In summary, the finance tracker works by providing users with a
simple and accessible tool for managing their finances, while
also serving as a practical project for developers to learn and
practice Python, Tkinter, SQLite, and Matplotlib.
SOURCE CODE:-
import tkinter as tk
from tkinter import ttk, messagebox
import sqlite3
from datetime import datetime

class FinanceTracker:
def __init__(self, root):
self.root = root
self.root.title("Finance Tracker")

# Variables
self.transaction_category_var = tk.StringVar()
self.transaction_amount_var = tk.DoubleVar()
self.budget_var = tk.DoubleVar(value=1000) # Set your
initial budget here

# Database
self.conn = sqlite3.connect(":memory:")
self.create_tables()

# UI Setup
ttk.Label(root, text="Category:").grid(row=0, column=0,
padx=10, pady=10, sticky="e")
ttk.Label(root, text="Amount:").grid(row=1, column=0,
padx=10, pady=10, sticky="e")
ttk.Entry(root,
textvariable=self.transaction_category_var).grid(row=0, column=1,
padx=10, pady=10)
ttk.Entry(root,
textvariable=self.transaction_amount_var).grid(row=1, column=1,
padx=10, pady=10)
ttk.Button(root, text="Add Transaction",
command=self.add_transaction).grid(row=2, column=0, columnspan=2,
pady=10)

# Budget and Balance


ttk.Label(root, text="Budget:").grid(row=3, column=0,
padx=10, pady=10, sticky="e")
ttk.Label(root, textvariable=self.budget_var).grid(row=3,
column=1, padx=10, pady=10, sticky="w")
ttk.Label(root, text="Balance:").grid(row=4, column=0,
padx=10, pady=10, sticky="e")
ttk.Label(root,
textvariable=self.calculate_balance()).grid(row=4, column=1,
padx=10, pady=10, sticky="w")

# Transaction History
self.display_transaction_history()

def create_tables(self):
cursor = self.conn.cursor()
cursor.execute("CREATE TABLE IF NOT EXISTS transactions
(id INTEGER PRIMARY KEY, category TEXT, amount REAL, date TEXT)")
self.conn.commit()

def add_transaction(self):
category = self.transaction_category_var.get()
amount = self.transaction_amount_var.get()

if category and amount:


date = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
cursor = self.conn.cursor()
cursor.execute("INSERT INTO transactions (category,
amount, date) VALUES (?, ?, ?)", (category, amount, date))
self.conn.commit()

self.display_transaction_history()
self.update_balance()

def calculate_balance(self):
cursor = self.conn.cursor()
cursor.execute("SELECT SUM(amount) FROM transactions")
total_amount = cursor.fetchone()[0] or 0
return self.budget_var.get() - total_amount

def update_balance(self):
balance = self.calculate_balance()
self.budget_var.set(balance)

def display_transaction_history(self):
cursor = self.conn.cursor()
cursor.execute("SELECT category, amount, date FROM
transactions")
transactions = cursor.fetchall()
ttk.Label(self.root, text="Transaction
History:").grid(row=5, column=0, columnspan=2, pady=10)
tree = ttk.Treeview(self.root, columns=("Category",
"Amount", "Date"), show="headings", height=5)
tree.heading("Category", text="Category")
tree.heading("Amount", text="Amount")
tree.heading("Date", text="Date")
tree.grid(row=6, column=0, columnspan=2, padx=10,
pady=10)

for transaction in transactions:


tree.insert("", "end", values=transaction)

if __name__ == "__main__":
root = tk.Tk()
app = FinanceTracker(root)
root.mainloop()
OUTPUT:-
Output No. 1-
Output No.2:-

You might also like