Skip to content

teogame3d-alt/digital-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Library

Python console app that simulates a small library workflow: add/search books, borrow/return, and persist state to JSON.

Library Project Screenshot

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.

Why This Project Matters

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

Core Features

  • 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

Architecture

  • Book, Reader, Library classes define the domain model.
  • A menu-driven CLI orchestrates user actions.
  • JSON persistence keeps data durable between sessions.

Proof of Work

  • 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.

Difficult Parts / Tradeoffs

  • 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.

Tech Stack

Python, JSON, pytest.

Quick Start

python digital_library.py

Demo Flow

1) Add a new book
2) Borrow that book
3) Save data to JSON
4) Restart app and load JSON
5) Confirm state is preserved

Example Output (trimmed)

Books in Central Library:
 - The Little Prince - Antoine de Saint-Exupery - available

==== LIBRARY REPORT ====
Total books: 3
Available books: 2
Borrowed books: 1

Tests

python -m pytest

Project Structure

digital-library/
+-- digital_library.py
+-- library_data.json
+-- tests/
+-- docs/

Development Timeline

  • Core implementation: OOP model, borrow/return rules, JSON persistence, and tests.
  • Recent polish: screenshot refresh and README restructuring for clearer technical review.

Notes

  • library_data.json can be edited to preload a custom catalog.
  • The app starts with a small demo dataset for quick validation.

Engineering Notes

See docs/ENGINEERING_NOTES.md for technical rationale, build-vs-polish context, and learning notes.

About

Digital library app in Python: OOP domain modeling, borrow/return workflow, JSON persistence, and tests.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages