Utilizing SQlite database, SQlite studio, read-write functionality to delete/edit/update contacts with Python, and more.
This is a project for managing contacts using a graphical user interface (GUI) built with the Tkinter library in Python. The project provides a contact management system with features such as adding new contacts, viewing existing contacts, deleting selected contacts, and modifying selected contacts.
The contacts are stored in an SQLite database (contacts.db) and the GUI allows users to interact with the data through a tree view widget.
Additionally, the project includes an API for interacting with the contact data programmatically, providing external access to the contact management functionality.
Creating tables in the database:
Creating contacts in the database:
Downloading Tkinter, our Python GUI:
Starting Code:
Adding a logo and code for widgets for the application:
Adding a LabelFrame, labels, entry fields for contacts, and a button:
Now, we’re going to add another label where we’d be able to see a message come up when we add or delete a lead or a contact. We’re going to be using a treeview widget from tkinter that will allow us to display messages. Some of the code development:
So right now, we’re seeing a message area but it’s not populated yet:
Changed some fonts and bolded the font. Also added a scroll bar and buttons to modify or delete entries.
Creating a function to be able to call the GUI:
Importing the SQL database into my application:
I'll create another function to be able to interact with the database. I'll also create a function to add new contacts into the database, validate inputs, and be able to fetch all records from the database to be able to display in treeview, the function that allows this in the application:
Adding contacts:
Adding contact message:
Now that we can add records and see it in the app, we want a way to delete records as well:
I'll also add this code block to deal with exceptions if you try to delete without having selected anything:
Wiring up buttons for the modify selected button and changing contacts:
Testing “modify selected” button:
Creating virtual environment, installing Django, installing REST framework
Registering products:
Creating API infob backend:
API: