Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Record Management System

Small Python CLI to keep a list of book records (id, title, author, year). You add, list, search, edit, delete, sort, and export the records to CSV. The list lives in a JSON file next to the script so it survives between runs.

Running it

You need Python 3.8 or newer. No pip install needed, only the standard library.

git clone https://github.com/tsarumar/Record-Management-System.git
cd Record-Management-System
python main.py

The menu opens:

--- Menu ---
1) Add record
2) List all
3) Search by ID
4) Search by title or author
5) Update record
6) Delete record
7) Sort records
8) Export to CSV
9) Quit

Pick a number and it walks you through the rest. IDs are assigned automatically starting at 1.

Screenshots

Empty menu right after start:

Menu

After adding a few records and listing them:

List

Editing an existing record:

Update

How the code is split

Each class has one job.

  • record.py defines the Book class with the four fields plus validators. If you try to add a record with an empty title or a year of apple, the validator raises a ValidationError and the menu just prints the message.
  • storage.py holds RecordStore. It loads records.json on startup, keeps the list in memory, and saves back after every change. Search, sort and CRUD all live here.
  • exporter.py has CSVExporter, which turns the list into a plain CSV file with id,title,author,year headers.
  • menu.py is the CLI. It reads input, calls the store, prints the result. That is all it does.
  • main.py starts the app.

About errors

Every value coming from input() gets sanitised and validated before it touches the record. Bad input (empty title, non-numeric year, taken id, missing record for delete) is caught and the menu prints a short message instead of crashing. If records.json gets corrupted between runs, the store logs nothing but silently starts with an empty list rather than throwing a stack trace at you.

Ctrl+C exits cleanly. Nothing else does anything scary; the only file the app writes is records.json (and records.csv if you export).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages