Python console app that simulates a small library workflow: add/search books, borrow/return, and persist state to JSON.
The image is a portfolio overview generated from the real OOP model. The application itself remains a CLI project, which keeps the focus on domain modeling, state transitions, persistence, and tests.
Additional visual references:
docs/images/Library_Shop.png: terminal workflow capture.docs/images/educational_flow.svg: learning flow from CLI usage to OOP and JSON persistence.
This project demonstrates foundational backend skills in a compact scope:
- object-oriented domain modeling
- deterministic state transitions
- persistence and reload behavior
- automated tests for core logic
- structured snapshot data that could later support a GUI or API layer
- Add, list, and search books
- Borrow and return flows with availability checks
- Save and load library state from
library_data.json - Generate a simple operational report
- Produce a structured
snapshot()summary for review or future UI/API use
Book,Reader,Libraryclasses define the domain model.- A menu-driven CLI orchestrates user actions.
- JSON persistence keeps data durable between sessions.
- Tests verify borrow/return state changes and persistence behavior.
- The CLI can be run without external services, accounts, or API keys.
snapshot()gives a structured view that could later feed a UI or API layer.
- The project stays intentionally small so OOP fundamentals are easy to inspect.
- JSON is used instead of a database because the goal is domain modeling and persistence basics.
- The CLI is simple by design; the value is in predictable state transitions and tests.
Python, JSON, pytest.
python digital_library.py1) Add a new book
2) Borrow that book
3) Save data to JSON
4) Restart app and load JSON
5) Confirm state is preserved
Books in Central Library:
- The Little Prince - Antoine de Saint-Exupery - available
==== LIBRARY REPORT ====
Total books: 3
Available books: 2
Borrowed books: 1
python -m pytestdigital-library/
+-- digital_library.py
+-- library_data.json
+-- tests/
+-- docs/
- Core implementation: OOP model, borrow/return rules, JSON persistence, and tests.
- Recent polish: screenshot refresh and README restructuring for clearer technical review.
library_data.jsoncan be edited to preload a custom catalog.- The app starts with a small demo dataset for quick validation.
See docs/ENGINEERING_NOTES.md for technical rationale, build-vs-polish context, and learning notes.
