How semenovamar1a/test-task works
Project type and purpose
• This is a standalone, single‐process, console (CLI) application written in Python.
• Its purpose is to provide CRUD and search operations on a collection of books persisted in a local JSON file.
File structure
• Top level only:
• main.py – the single entry point; contains the program loop and dispatches user commands.
• library.json – the persisted data store in JSON format.
• README.md – documentation of functions and data structure.
• No subdirectories or external modules—this is a monolithic script.
README for additional insights
• Core functions live in main.py:
• save_json / load_json_or_create (persistence layer)
• add_book, remove_book, search_book, change_status (business logic)
• main loop presenting menu and parsing user input (presentation layer)
• Data model: a dict keyed by book-ID, each value holding title, author, year, status.
Capturing essential details
• Six user actions as separate operations in the Business Logic layer.
• Error/fallback path in Data Access: “if library.json missing → create default structure.”
• Persistence calls with method names (load_json_or_create(), save_json()).