Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a Persistent Smart Contact Book CLI App Using Pure Python

Hello DEV Community! As a 2nd-year BCA student aspiring to become a Web / Developer Advocate , I believe that mastering data structures, error handling, and file persistence is crucial. Today, I am excited to share my 4th python project: a Smart Contact Book CLI Application built completely from scratch! Unlike basic scripts that lose data when closed, this tool stores all data locally and…

In a recent project aimed at aspiring web developers, a second-year BCA student demonstrates their growth in technical skills with a fully-featured Smart Contact Book CLI application. This command-line interface (CLI) tool distinguishes itself from simpler scripts by offering robust local data persistence and efficient input validation.

The cornerstone of this project is the contacts.json file, where all contact information is securely stored. This approach ensures that the application never loses data, even when it is closed. The application employs rigorous input validation, guaranteeing that phone numbers adhere to a 10-digit format and email addresses follow the standard @ and . structure.

The tool provides full CRUD (Create, Read, Update, Delete) operations, allowing users to easily manage their contact list through a continuous interactive menu. This feature set showcases the application's versatility and practical utility.

To ensure reliability, the application incorporates try-except blocks. These blocks gracefully handle scenarios such as empty inputs or missing files, preventing the system from crashing due to unforeseen errors.

Through this project, the student gained valuable experience in several key backend concepts. They learned how to perform file input/output (I/O) and JSON parsing using Python's built-in json module. Additionally, they developed their skills in defensive programming by anticipating and handling bad user inputs before they could cause system crashes. The project also provided hands-on experience with Git workflow management, enabling efficient staging, committing, and repository file management within Visual Studio Code.

The student has generously shared their complete codebase on GitHub, inviting feedback and discussion. They are currently contemplating future enhancements, such as the addition of an edit/update feature or the migration of data handling to a SQLite database. The student eagerly awaits input from their community to further refine and improve their application.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 20 September →