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.
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.
Empty menu right after start:
After adding a few records and listing them:
Editing an existing record:
Each class has one job.
record.pydefines theBookclass with the four fields plus validators. If you try to add a record with an empty title or a year ofapple, the validator raises aValidationErrorand the menu just prints the message.storage.pyholdsRecordStore. It loadsrecords.jsonon startup, keeps the list in memory, and saves back after every change. Search, sort and CRUD all live here.exporter.pyhasCSVExporter, which turns the list into a plain CSV file withid,title,author,yearheaders.menu.pyis the CLI. It reads input, calls the store, prints the result. That is all it does.main.pystarts the app.
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).


